Sum of two arrays

only the 1st digit is printing wrong, rest is okay.


please correct.
also, i have only assumed only one case for now that is when (n>m).

hello @Sakshi_Suman
ur logic is partially correct.

do a dry run on this test case
arr 1-> 1 2 3 4 5 6
arr 2 -> 3

why is this code giving wrong output in this

arr 1 3 4 5 6 7 arr 2 1 0 2 9

if it is partially correct, how do i correct it fully?

image
because of this condition.
this loop will break when one of the case get voilated.

but i might happen that even after the loop breaks, we have some elements left in one of the array.
so we need to again run a loop, to copy the remaining array

how do we do that?..

thankyou, i got it!..

cool :+1: . . . .:+1: . … :+1: . . .:+1: .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.