Skip to content

Commit 0f9bb82

Browse files
authored
Merge pull request #1 from qiuguomeng/qiuguomeng-patch-1
Create 。。。.md
2 parents 97c4cce + b8636c2 commit 0f9bb82

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

2018.11.26-leetcode11/。。。.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)