()
| 116 | const isCurrHeightLess = ([prevIndex, prevHeight], currHeight) => |
| 117 | currHeight < prevHeight; |
| 118 | const canShrink = () => |
| 119 | isCurrHeightLess(stack[stack.length - 1], heights[index]); |
| 120 | while (stack.length && canShrink()) { |
| 121 | /* Time O(N + N) */ |
| 122 | const [_index, _height] = stack.pop(); |
no test coverage detected