File tree 4 files changed +6
-6
lines changed
src/hackerrank/interview_preparation_kit/arrays
4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import { logger as console } from '../../../logger.js' ;
7
7
8
- export function arrayManipulation ( n , queries ) {
8
+ function arrayManipulation ( n , queries ) {
9
9
const LENGTH = n + 1 ;
10
10
const SURROGATE_VALUE = 0 ;
11
11
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';
3
3
4
4
import TEST_CASES from './cruch_testcases_test.json' ;
5
5
6
- import { arrayManipulation } from './cruch_bruteforce.js' ;
6
+ import crush from './cruch_bruteforce.js' ;
7
7
8
8
describe ( 'arrays: crush (bruteforce) small cases' , ( ) => {
9
9
it ( 'arrayManipulation Test Cases' , ( ) => {
10
10
expect . assertions ( 3 ) ;
11
11
12
12
TEST_CASES . forEach ( ( test ) => {
13
- const answer = arrayManipulation ( test . n , test . queries ) ;
13
+ const answer = crush . arrayManipulation ( test . n , test . queries ) ;
14
14
15
15
console . debug (
16
16
`arrayManipulation(${ test . n } , ${ test . queries } ) solution found: ${ answer } `
Original file line number Diff line number Diff line change 2
2
* @link Problem definition [[docs/hackerrank/interview_preparation_kit/arrays/crush.md]]
3
3
*/
4
4
5
- export function arrayManipulation ( n , queries ) {
5
+ function arrayManipulation ( n , queries ) {
6
6
// why adding 2?
7
7
// first slot to adjust 1-based index and
8
8
// 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';
3
3
4
4
import TEST_CASES from './cruch_testcases_test.json' ;
5
5
6
- import { arrayManipulation } from './cruch_optimized.js' ;
6
+ import crush from './cruch_optimized.js' ;
7
7
8
8
describe ( 'arrays: crush (optimized)' , ( ) => {
9
9
it ( 'arrayManipulation Test Cases' , ( ) => {
10
10
expect . assertions ( 3 ) ;
11
11
12
12
TEST_CASES . forEach ( ( test ) => {
13
- const answer = arrayManipulation ( test . n , test . queries ) ;
13
+ const answer = crush . arrayManipulation ( test . n , test . queries ) ;
14
14
15
15
console . debug (
16
16
`arrayManipulation(${ test . n } , ${ test . queries } ) solution found: ${ answer } `
You can’t perform that action at this time.
0 commit comments