([prevIndex, prevHeight], currHeight)
| 114 | let start = index; |
| 115 | |
| 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()) { |