标签:i++ http cpp ++ mamicode class 技术 lse .com
int max(int a,int b) { return a>=b?a:b;} int min(int a,int b) { return a>=b?b:a;} int maxArea(int* height, int heightSize) { int i = 0; int j = heightSize-1; int area = 0; int dist = 0; int h = 0; while(i<j) { dist = j-i; h = min(height[i],height[j]); area = max(area,dist*h); if(height[i]<height[j]) i++; else j--; } return area; }
标签:i++ http cpp ++ mamicode class 技术 lse .com
原文地址:https://www.cnblogs.com/czsblog/p/10584034.html