标签:分享 image bubuko int ima bsp 执行时间 vector height
方法1:Brute Force(执行时间惨不忍睹,共进行)
class Solution { public: int maxArea(vector<int>& height) { int res=0; for(int i=0;i<height.size();i++) for(int j=i+1;j<height.size();j++) res = max(res,min(height[i],height[j])*(j-i)); return res; } };
11. Container With Most Water C++
标签:分享 image bubuko int ima bsp 执行时间 vector height
原文地址:https://www.cnblogs.com/tornado549/p/9949825.html