From 484093ad99a9b72e52ec90794c8052dbc2504dd8 Mon Sep 17 00:00:00 2001 From: gsejal <116021271+gsejal@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:45:59 +0530 Subject: [PATCH] Create Container_with_most_water.cpp --- c++/Container_with_most_water.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 c++/Container_with_most_water.cpp diff --git a/c++/Container_with_most_water.cpp b/c++/Container_with_most_water.cpp new file mode 100644 index 0000000..a2316d5 --- /dev/null +++ b/c++/Container_with_most_water.cpp @@ -0,0 +1,20 @@ +//https://leetcode.com/problems/container-with-most-water/ + +class Solution { +public: + int maxArea(vector& height) + { + int area=0; + int l=0; + int r=height.size()-1; + while (l