We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
then my question is when i enter the input for first operation then at a[5]=600 and a[8]=-600 now when i enter the input for second operation then a[1]=500 and a[5] becomes 100 as it was earlier 600(i.e 600-500). can anybody please explain how i got output as 600.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
I gave custom input as
10 2 5 7 600 1 4 500
and i got output as 600
then my question is when i enter the input for first operation then at a[5]=600 and a[8]=-600 now when i enter the input for second operation then a[1]=500 and a[5] becomes 100 as it was earlier 600(i.e 600-500). can anybody please explain how i got output as 600.