For each position, find the nearest index to the left with a strictly smaller value.
Constraints
Example
>>> previous_smaller([3, 1, 5, 7, 4, 2]) [-1, -1, 1, 2, 1, 1] >>> previous_smaller([1, 2, 3, 4]) [-1, 0, 1, 2] >>> previous_smaller([]) []
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints