Closed misstonbon closed 5 years ago
Hey @misstonbon! Can you give me an example where the code breaks? The code should work provided your array with: array = [7,4,2,9,9,15,1]
. The answer returned should be 13
, which is the difference between 2 and 15
array = [7,4,2,9,9,15,1]
The answer doesn't handleif array[i] === array[i-1]
or in the case of array above,9,9