Container With Most Water
Examples
Example 1:
Input: height = [1,7,2,5,4,7,3,6]
Output: 36
Example 2:
Input: height = [2,2,2]
Output: 4
Example 1:
Input: height = [1,7,2,5,4,7,3,6]
Output: 36
Example 2:
Input: height = [2,2,2]
Output: 4
You are given an integer array heights where heights[i] represents the height of the bar.
You may choose any two bars to form a container. Return the maximum amount of water a container can store.
2 <= height.length <= 10000 <= height[i] <= 1000