int maxArea(vector<int>& height) {
int max=0,s=0;
for(int i=0;i<height.size();i++)
for(int j=i;j<height.size();j++)
{
if(height[i]>height[j])
s=(j-i)*height[j];
else
s=(j-i)*height[i];
if(s>max)max=s;
}
return max;
}
Leetcode 第11题
猜你喜欢
转载自blog.csdn.net/TempterCyn/article/details/82871296
今日推荐
周排行