File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
src/hackerrank/interview_preparation_kit/arrays Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 55
66import { logger as console } from '../../../logger.js' ;
77
8- export function arrayManipulation ( n , queries ) {
8+ function arrayManipulation ( n , queries ) {
99 const LENGTH = n + 1 ;
1010 const SURROGATE_VALUE = 0 ;
1111 const result = Array ( LENGTH ) . fill ( SURROGATE_VALUE ) ;
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ import { logger as console } from '../../../logger.js';
33
44import TEST_CASES from './cruch_testcases_test.json' ;
55
6- import { arrayManipulation } from './cruch_bruteforce.js' ;
6+ import crush from './cruch_bruteforce.js' ;
77
88describe ( 'arrays: crush (bruteforce) small cases' , ( ) => {
99 it ( 'arrayManipulation Test Cases' , ( ) => {
1010 expect . assertions ( 3 ) ;
1111
1212 TEST_CASES . forEach ( ( test ) => {
13- const answer = arrayManipulation ( test . n , test . queries ) ;
13+ const answer = crush . arrayManipulation ( test . n , test . queries ) ;
1414
1515 console . debug (
1616 `arrayManipulation(${ test . n } , ${ test . queries } ) solution found: ${ answer } `
Original file line number Diff line number Diff line change 22 * @link Problem definition [[docs/hackerrank/interview_preparation_kit/arrays/crush.md]]
33 */
44
5- export function arrayManipulation ( n , queries ) {
5+ function arrayManipulation ( n , queries ) {
66 // why adding 2?
77 // first slot to adjust 1-based index and
88 // last slot for storing accumSum result
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ import { logger as console } from '../../../logger.js';
33
44import TEST_CASES from './cruch_testcases_test.json' ;
55
6- import { arrayManipulation } from './cruch_optimized.js' ;
6+ import crush from './cruch_optimized.js' ;
77
88describe ( 'arrays: crush (optimized)' , ( ) => {
99 it ( 'arrayManipulation Test Cases' , ( ) => {
1010 expect . assertions ( 3 ) ;
1111
1212 TEST_CASES . forEach ( ( test ) => {
13- const answer = arrayManipulation ( test . n , test . queries ) ;
13+ const answer = crush . arrayManipulation ( test . n , test . queries ) ;
1414
1515 console . debug (
1616 `arrayManipulation(${ test . n } , ${ test . queries } ) solution found: ${ answer } `
You can’t perform that action at this time.
0 commit comments