Tell us what’s happening:
My code will execute the first three tasks properly but fails for the last task and I think it might have to do with the negative numbers. Looking at solution 1, my code is very similar except that I have defined ‘largestSub = 0;’ out side of the for loop. If I move this line outside of the inner for loop it still fails. I am curious as to why the solution defines theirs as’ largestNumber = arr[n][0];’. Why wouldnt it just be ‘largestNumber = 0’?
You actually answered your own question with the first sentence. Your code currently assumes that the largest number is always greater than 0. The solution code doesn’t make such an assumption, it just starts with the first number in the array.