LeetCode 11: Container With Most Water — Step-by-Step Visual Trace
Medium — Array | Two Pointers | Greedy
The Problem
Given an array of heights representing vertical lines, find two lines that together with the x-axis form a container that can hold the most water.
Approach
Use two pointers starting from both ends of...
blog.tracelit.dev1 min read