Container With Most Water Time : Space : 1234567891011int Solution::maxArea(vector<int> &A) { int l = 0, r = A.size() - 1; int res = 0; while(l < r) { res = max(res, (r - l) * min(A[l], A[r])); if(A[l] < A[r]) l++; else r--; } return res;}