Skip to content

Commit 53c97f2

Browse files
committed
Removed uncalled "padding" logic
Normally, when generating combos from 0, we need to pad the combos so the length will be the same as the max value. 0 becomes 000 for max of 111 However, in this case we start generating combos such that no padding is ever needed. For max value of 111 we start at 100 1111 starts at 1000, etc.
1 parent 56a4976 commit 53c97f2

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

medium/array_min_jumps.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ function arrayMinJumps(arr) {
2424
let combos = [];
2525
for (let max = Math.pow(2, arr.length), i = max / 2; i < max; i++) {
2626
let combo = i.toString(2);
27-
// Pad combo
28-
while (combo.length < arr.length) {
29-
combo = '0' + combo;
30-
}
3127
combos.push(combo);
3228
}
3329

0 commit comments

Comments
 (0)