LeetCode 42: Trapping Rain Water — Step-by-Step Visual Trace
Hard — Two Pointers | Array | Dynamic Programming | Stack
The Problem
Given an elevation map represented by an array of non-negative integers, calculate how much water can be trapped after raining.
Approach
Uses two pointers starting from both ends o...
blog.tracelit.dev1 min read