11. Container With Most Water
class Solution {
public:
int maxArea(vector<int>& height) {
int start = 0, end = height.size()-1;
int area=0,res=0;
while(start<end){
if(height[start]>height[end]){
area = height[end]*(end-start);
end--;
}
else{
area = height[start]*(end-start);
start++;
}
res = res<area ? area : res;
}
return res;
}
};