Monotonic Stack 도입을 통한 시간 복잡도 O(N*M)에서 O(N+M)으로 최적화
Next Greater Element I | Monotonic Stack
Next Greater Element I | Monotonic Stack
The Monotonic Stack: Like Gandalf's Staff for Array Problems
Algorithmic intuition matters more than problem count in coding interviews