What is the problem in this sum of array code?
Hello @itismohiton,
-
As in the first iteration of while loop you are accessing n,m and temp index which are not valid indexes for their corresponding arrays.
-
Wrong if condition inside the second while loop.
I have corrected your code:
Hope, this would help.
Give a like if you are satisfied.
It is still not passing all test cases.
Hello @itismohiton,
Are you sure?
I myself tested it for all the test cases and it is giving correct output.
1 Like
Sorry, Itβs passing all test cases now.