Solution1 单调栈
单调栈递减。如果遇到一个大于栈顶的元素,说明这个元素就是当前栈顶元素的next greater element
But we store index stead of number directly.
Last updated
Was this helpful?
单调栈递减。如果遇到一个大于栈顶的元素,说明这个元素就是当前栈顶元素的next greater element
But we store index stead of number directly.
Last updated
Was this helpful?