2. go through the array and maintain a strictly monotonically increasing stack, in the stack we store the index instead of height value. 3. when we get to index i, if height at i is greater than height of stack top, we push i into the stack, or 4. pop out the top of stack, de...
leetcode(1236) java(1236) array(478) javascript(290) string(273) hashmap(235) math(159) greedy(147) tree(142) dfs(142) two pointer(136) sort(121) bfs(105) dynamic programming(102) binary search(81) stack(75) sliding window(68) design(65) prefix sum(59)...