Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
That plateau after the peak is not a plateau-peak, it's just a plateau.
At index 20 there is a plateau-peak.
for arr [1,2,5,4,3,2,3,6,4,1,2,3,3,4,5,3,2,1,2,3,5,5,4,3],
expected { pos: [ 2, 7, 14 ], peaks: [ 5, 6, 5 ] } to deeply equal { pos: [ 2, 7, 14, 20 ], peaks: [ 5, 6, 5, 5 ] }. How ?
expected { pos: [ 2, 3 ], peaks: [ 3, 2 ] } to deeply equal { pos: [ 2 ], peaks: [ 3 ] }
assert.deepEqual(pickPeaks([2,1,3,2,2,2,2,5,6]), {pos:[2], peaks:[3]});
why?