(int[] height)
| 1 | class Solution { |
| 2 | public int maxArea(int[] height) |
| 3 | { |
| 4 | int b1=0; |
| 5 | int b2=height.length-1; |
| 6 | int r=0; |
| 7 | while(b1<b2) |
| 8 | { |
| 9 | int curMax=(b2-b1)*Math.min(height[b1],height[b2]); |
| 10 | if(height[b1]<height[b2]) |
| 11 | { |
| 12 | b1++; |
| 13 | } |
| 14 | else |
| 15 | { |
| 16 | b2--; |
| 17 | } |
| 18 | r=Math.max(r,curMax); |
| 19 | } |
| 20 | return r; |
| 21 | } |
| 22 | } |
nothing calls this directly
no outgoing calls
no test coverage detected