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.