💧 Container With Most Water

Two-Pointer Algorithm Visualization

📝 Custom Input

Quick Examples:
Current Input: [1,8,6,2,5,4,8,3,7] Expected Output: 49
Normal Bar
Left Pointer
Right Pointer
Water Area
Left Pointer
Index: 0
Height: 1
Right Pointer
Index: 8
Height: 7
Area = min(1, 7) × (8 - 0) = 1 × 8
8
Maximum Area Found
8
Step 0 of 0

Step 0: Initialize Pointers

Start with left pointer at beginning (index 0) and right pointer at end. Calculate initial area.

📊 Algorithm State

Left: 0
Right: 8
Current Area: 8
Max Area: 8

📝 Problem Info

Array Length: 9

Algorithm: Two Pointers

Time Complexity: O(n)

Space Complexity: O(1)

Strategy: Move pointer with smaller height inward