Find two lines that together with the x-axis form a container such that the container holds the maximum amount of water.
Return the maximum amount of water a container can store. The amount of water a container can store is determined by: Width Ć Minimum Height
Example 1:
Input: height = [1,8,6,2,5,4,8,3,7]
Output: 49
Explanation: The container formed by heights 8 and 7 stores the maximum water.
Width = 7
Minimum Height = 7
Area = 7 Ć 7 = 49
Example 2:
Input: height = [1,1]
Output: 1
Explanation:
Width = 1
Minimum Height = 1
Area = 1 Ć 1 = 1
Example 3:
Input: height = [4,3,2,1,4]
Output: 16
Explanation: The first and last lines form the largest container.
Width = 4
Minimum Height = 4
Area = 4 Ć 4 = 16