← All problemsSign in

Trapping Rain water

Given an array arr[] of N non-negative integers representing the height of blocks. If the width of each block is 1, compute how much water can be trapped between the blocks during the rainy season. ---| ---| |--| |--| |--| ||-| ||-| ||-| ||-| ------ ### Input First line contains the number of test cases Second line contains the columns of blocks Third line contains the blocks in each c

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start