Given an array of numbers, remove all numbers that don't increase in value from the previous. Return a new array.

// input:
const a = [1, 2, 2, 3, 2, 4, 5]

// output:
[1, 2, 3, 4, 5]

Test Cases

Loading...
/* output */

Next