Container With Most Water - (Meta, Google, Amazon) : Explanation ➕ Live Coding 🧑🏻‍💻👩🏻‍💻

  Рет қаралды 9,422

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 26
@Kunalbindra
@Kunalbindra 5 ай бұрын
He never asked us for like , share and subscribe 🙇‍♂. A True GEM...
@Kaafirpeado54-6ayesha
@Kaafirpeado54-6ayesha 2 ай бұрын
Question is so intimidating i have seen this question and left it right away
@varunupadhyay2488
@varunupadhyay2488 Күн бұрын
great explanation
@sonukumarram1880
@sonukumarram1880 9 ай бұрын
Ur explanations , the way of teaching .... big fan sir really feeling blessed
@Satya-g5t
@Satya-g5t 10 күн бұрын
nice solution and well explained.
@surajsidar3280
@surajsidar3280 5 ай бұрын
I am watching the solution after the interview. I was asked how and why we were moving two pointers. I got the answer. We have to find a minimum of two heights of left and right pointer Since we are decreasing the width, to maximize the water contained we will move the pointer pointing to a smaller height.
@moinkhan2137
@moinkhan2137 5 ай бұрын
which Company Bro?
@tutuimam3381
@tutuimam3381 Жыл бұрын
Amazing explanation
@prashupandey1304
@prashupandey1304 Жыл бұрын
You are the best bro !!!🙏🙏
@codestorywithMIK
@codestorywithMIK Жыл бұрын
And so are you Prashu Thank you so much 🙏❤️😇
@isha25tripathi12
@isha25tripathi12 6 ай бұрын
Thank you so much. When I first read the question I was afraid that its too difficult and when you read the question I was able to do it on my own without listening to the whole explanation.
@PushpendraKushvaha
@PushpendraKushvaha 5 ай бұрын
same
@saketjaiswalSJ
@saketjaiswalSJ 7 ай бұрын
god level explanation brother
@ikitayadav3272
@ikitayadav3272 4 ай бұрын
omg why i didn't find this channel earlier
@cosmicthor7330
@cosmicthor7330 2 ай бұрын
bhaeeya if index 2 pey 6 ki jagah koi bara number hota jaisey 45 to area hamara chut jata na ,kiwki dono height same hai start and end ka if uskey neigher ka height bara ho to compare krna pareyga na kis side move krey i ko ya j ko hope mai smjha paya apna question
@nitkarshchourasia2406
@nitkarshchourasia2406 Ай бұрын
class Solution { public: int maxArea(vector& height) { // find length // find height int n = height.size(); int left = 0; int right = n -1; int maximum = INT_MIN; while (left < right) { int l = right - left; int h = std::min(height[left], height[right]); (height[right] > height[left]) ? left++ : right--; int k = l * h; if (k > maximum) { maximum = k; cout
@harshsingh7713
@harshsingh7713 9 ай бұрын
Bhai aapke subscriber bhut tezz badd rhe Badhai ho
@abcd76820
@abcd76820 8 ай бұрын
cant we apply trapping rain water problem logic with modification ?
@rode_atharva
@rode_atharva 5 ай бұрын
class Solution { public: int maxArea(vector& height) { int maxwater = 0; int left = 0; int right = height.size()-1; while(left < right){ maxwater = max(maxwater, min(height[left], height[right])*(right-left)); if(height[left] < height[right]){ left++; } else{ right--; } } return maxwater; } };
@AnkitJain-w3l
@AnkitJain-w3l 8 ай бұрын
Day 3
@DeepakSingh-fd2ix
@DeepakSingh-fd2ix Жыл бұрын
sir how this question is different from maximum area histogram
@harchitgulati3065
@harchitgulati3065 10 ай бұрын
same doubt
@parul15137
@parul15137 7 ай бұрын
in that we were seeing consecutive heightss to form a rectangle by using the concept of nsl and nsr of stack by taking the current idx height but there isnt any consecutiveness , but here we are storing the water even if the heights in b/w are smaller or bigger we can take them cos water will be stored b/w so we dont care what heights are coming in b/w but in the histogram one if the fluctuation of heights occured our rectangle will be disformed which we dont want
@Codenow10222
@Codenow10222 6 ай бұрын
when the height is same why are we allowed to shift any of them i and j . because in the above question when both i and j if we move i then the maxArea is 24 but if we move from j then it will be 16
@Lakshya-f4l
@Lakshya-f4l 4 ай бұрын
same question
@varshneyshuchi
@varshneyshuchi 4 ай бұрын
whatever you choose .. will it effect maximum?
За кого болели?😂
00:18
МЯТНАЯ ФАНТА
Рет қаралды 3,2 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,6 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 36 МЛН
Container With Most Water | leetcode 11 | Hindi
14:19
Codebix
Рет қаралды 83 М.
Minimax with Alpha Beta Pruning
13:44
John Levine
Рет қаралды 348 М.
Container with Most Water - Leetcode 11 - Python
12:37
NeetCode
Рет қаралды 365 М.
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 740 М.
Trapping Rain Water - Google Interview Question - Leetcode 42
23:21
How to Turn Employees into Brand Ambassadors
3:37
Kim Lawton
Рет қаралды 10
За кого болели?😂
00:18
МЯТНАЯ ФАНТА
Рет қаралды 3,2 МЛН