MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / isCurrHeightLess

Function isCurrHeightLess

javascript/0084-largest-rectangle-in-histogram.js:116–117  ·  view source on GitHub ↗
([prevIndex, prevHeight], currHeight)

Source from the content-addressed store, hash-verified

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()) {

Callers 1

canShrinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected