LeetCode / Container With Most Water
Problem
- Link
- Description
- 가장 많은 양의 물이 달길 Container 찾기
- Type
- Two Pointers Pattern
Solution 1
| |
- Description
- List의 양쪽으로 부터 하나씩 Index를 조정하면서 가장 넓은 영역을 탐색
- Height가 작은 Index를 하나씩 움직이며 넓이를 탐색
- Time Complexity
- O(n)
- Space Complexity
- O(1)