Plus Minus

Problem from Hackerrank.

I was making the mistake of checking if the index was bigger or smaller than zero, instead of checking the value of the integer in that index. I was comparing i instead ,arr[i].

My solution:

 

Leave a Reply

Your email address will not be published.