He never asked us for like , share and subscribe 🙇♂. A True GEM...
@Kaafirpeado54-6ayesha2 ай бұрын
Question is so intimidating i have seen this question and left it right away
@varunupadhyay2488Күн бұрын
great explanation
@sonukumarram18809 ай бұрын
Ur explanations , the way of teaching .... big fan sir really feeling blessed
@Satya-g5t10 күн бұрын
nice solution and well explained.
@surajsidar32805 ай бұрын
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.
@moinkhan21375 ай бұрын
which Company Bro?
@tutuimam3381 Жыл бұрын
Amazing explanation
@prashupandey1304 Жыл бұрын
You are the best bro !!!🙏🙏
@codestorywithMIK Жыл бұрын
And so are you Prashu Thank you so much 🙏❤️😇
@isha25tripathi126 ай бұрын
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.
@PushpendraKushvaha5 ай бұрын
same
@saketjaiswalSJ7 ай бұрын
god level explanation brother
@ikitayadav32724 ай бұрын
omg why i didn't find this channel earlier
@cosmicthor73302 ай бұрын
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Ай бұрын
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
@harshsingh77139 ай бұрын
Bhai aapke subscriber bhut tezz badd rhe Badhai ho
@abcd768208 ай бұрын
cant we apply trapping rain water problem logic with modification ?
@rode_atharva5 ай бұрын
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-w3l8 ай бұрын
Day 3
@DeepakSingh-fd2ix Жыл бұрын
sir how this question is different from maximum area histogram
@harchitgulati306510 ай бұрын
same doubt
@parul151377 ай бұрын
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
@Codenow102226 ай бұрын
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