Array-Sum of Two Arrays

I solved but not getting fully submitted. So please look into this

code link is here:-

hello @krishav49 wait i will go through your code and let you know the error.

hey @krishav49 check this:


if you have any doubt you can ask here:
Happy Learning !!

if “n” and “m” are different then how the loop is terminated.
Here in vector how to push the elements abs(n-m) can’t understand right now.

hello @krishav49 you have used the and in the while loop if m and n are different then if either of them becomes negative then the while loop will terminate.
i have not changed to abs anwhere in the code.
if have any doubt you can ask here:
Happy Learning !!

Means you want to say that, if N > M after some iteration m becomes negative and using “and” operation (N-M) element push by while loop.
How, I not understand

hello @krishav49 no .
do you know exactly what while loop with and works?
while loop will only run until both n and m works.
if either of them becomes negative then the loop will terminate.

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.