dsa2 min read
Google — Trapping Rain Water II (3D BFS + Min-Heap)
Calculate how much water can be trapped in a 3D height matrix. Uses a min-heap BFS starting from the boundary, always processing the lowest border cell to determine water trapped inside.
Read →