We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97c4cce commit b8636c2Copy full SHA for b8636c2
2018.11.26-leetcode11/。。。.md
@@ -0,0 +1,12 @@
1
+ public int maxArea(int[] height) {
2
+ int left=0,right=height.length-1,area = 0;
3
+ while (left < right){
4
+ area = Math.max(area,(right-left)*Math.min(height[left],height[right]));
5
+ if (height[left] < height[right]){
6
+ left++;
7
+ }else {
8
+ right--;
9
+ }
10
11
+ return area;
12
0 commit comments