Bloomberg logoBloomberg
Coding·60 minMembers

Trapping Rain Water

Members only

Given an elevation map of non-negative bar heights, compute how much water can be trapped after raining. Bloomberg interviewers commonly insist on the two-pointer `O(1)`-space solution after a stack o...

SWE
two-pointer
array
monotonic-stack
dp
hard
Frequency
Single report
Last asked
2025-11-24
Stage
phone-screen · onsite-coding

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...