Fundamentals/Monotonic Stack/Deque Intro
← PrevNext →
Given an array of integers, return an array where result[i] is the next greater element to the right of arr[i], or -1 if none. Use a monotonic stack.