Problem Name : Container With Most Water
Problem Link : https://leetcode.com/problems/container-with-most-water/
Problem Statement: You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
Find two lines that together with the x-axis form a container, such that the container contains the most water.
Return the maximum amount of water a container can store.
Notice that you may not slant the container.
I've explained the thought process and logic behind the solution and show how to implement it in code. Please like, share and subscribe if you found the video useful. Feel free to ask in the comments section if you have any doubts.
00:00 : Introduction
00:08 : Understanding Question
02:47 : Brute Force Approach
04:22 : Optimised Approach
09:18 : Coding
#leetcodequestionandanswers #leetcodesolution #leetcode #leetcodesolutions #c++