#11 - Container With Most Water
Given an integer array height of length n, where each element represents the height of a vertical line drawn at index i, find two lines that together with the x-axis form a container that holds the most water. Return the maximum amount of water the container can store. The container may not be slanted.
| Input | Output |
|---|---|
height = [1,8,6,2,5,4,8,3,7] | 49 |
height = [1,1] | 1 |
height = [4,3,2,1,4] | 16 |