Skip to main content

5 docs tagged with "Monotonic Stack"

View all tags

Next Greater Element II

Given a circular integer array nums (i.e., the next element of `nums[nums.length - 1]` is `nums[0]`), return the next greater number for every element in nums..

Stock Spanner

This is a solution to the Stock Spanner on LeetCode.

Trapping Rain Water(LeetCode)

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.