LeetCode / Container With Most Water
Problem
- Link
- Description
- Find the container that can hold the most water
- Type
- Two Pointers Pattern
Solution 1
| |
- Description
- Search for the widest area by adjusting indices from both sides of the list one by one
- Move the index with smaller height one by one to search for the area
- Time Complexity
- O(n)
- Space Complexity
- O(1)