集团公司网站案例,seo营销专员,wordpress清理不用插件,域名解析查询网题目#xff1a; 
考虑到盛水容器的特殊性。双指针从最两边开始遍历#xff0c;遍历过程中舍弃最小的。 
不知道原理。 
模板的#xff1a; 
class Solution {
public:/*** 代码中的类名、方法名、参数名已经指定#xff0c;请勿修改#xff0c;直接返回方法规定的值即可*…题目 
考虑到盛水容器的特殊性。双指针从最两边开始遍历遍历过程中舍弃最小的。 
不知道原理。 
模板的 
class Solution {
public:/*** 代码中的类名、方法名、参数名已经指定请勿修改直接返回方法规定的值即可** * param height int整型vector * return int整型*/int maxArea(vectorint height) {// write code hereint n  height.size();if(n  2)return 0;int l  0;int r  n-1;int ans  0;while(lr){ans  max(ans, min(height[l], height[r])*(r-l));if(height[l]  height[r])l;elser--;}return ans;}
};