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.
2 parents 737e3a1 + 74489b4 commit 1283dc3Copy full SHA for 1283dc3
2018.11.25-leetcode11/sourcema.md
@@ -0,0 +1,16 @@
1
+# leetcode 11
2
+ public int maxArea(int[] height) {
3
+ if (height == null || height.length == 0) {
4
+ return 0;
5
+ }
6
+ int left=0,right=height.length-1,result=0;
7
+ while (left < right) {
8
+ result = Math.max(result, Math.min(height[left], height[right]) * (right - left));
9
+ if (height[left] <= height[right]) {
10
+ left++;
11
+ } else {
12
+ right--;
13
14
15
+ return result;
16
0 commit comments