Skip to content

Commit 7f68a70

Browse files
Completed Arrays section (Closes CoffeelessProgrammer#2)
1 parent 7d86b68 commit 7f68a70

File tree

5 files changed

+0
-5
lines changed

5 files changed

+0
-5
lines changed

Playground/Challenges/Merge_Sorted_Arrays.ts renamed to Playground/Challenges/Arrays/Merge_Sorted_Arrays.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,27 @@ function mergeSortedArrays(arr1: number[], arr2: number[]): Array<number> { //
1313
for(let i=0,j=0; i <= arr1.length && j <= arr2.length;) {
1414

1515
if (i === arr1.length && j === arr2.length) {
16-
// console.log("Processed both arrays!")
1716
break;
1817
}
1918

2019
if (i === arr1.length) {
2120
largeSorted.push(arr2[j]);
2221
++j;
23-
// console.log('Pushing', largeSorted[largeSorted.length-1], ' New j:', j);
2422
continue;
2523
}
2624

2725
if (j === arr2.length) {
2826
largeSorted.push(arr1[i]);
2927
++i;
30-
// console.log('Pushing', largeSorted[largeSorted.length-1], ' New i:', i);
3128
continue;
3229
}
3330

3431
if (arr1[i] < arr2[j]) {
3532
largeSorted.push(arr1[i]);
3633
++i;
37-
// console.log('Pushing', largeSorted[largeSorted.length-1], ' New i:', i);
3834
} else {
3935
largeSorted.push(arr2[j])
4036
++j;
41-
// console.log('Pushing', largeSorted[largeSorted.length-1], ' New j:', j);
4237
}
4338
}
4439

0 commit comments

Comments
 (0)