Back
Monotonic Stack
Question 1 of 12
8% Complete
Medium
To compute 'next smaller to left' for each element, you should...
A
Sort then scan
B
Scan left→right with a monotonic increasing stack of indices
C
Scan right→left with a monotonic decreasing stack
D
Use two pointers