MCPcopy Index your code
hub / github.com/TheAlgorithms/C / trap

Function trap

leetcode/src/42.c:10–27  ·  view source on GitHub ↗

Max stack. Runtime: O(n), Space: O(n) Algorithm description: - Calculate the stack of maximums from right board. - For each index find left maximum and right maximum of height - The each index if heights could place nor greater than minimum of left and right max minus curr height - Sum all index in result

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 2

minFunction · 0.85
maxFunction · 0.70

Tested by

no test coverage detected