Trapping Rainwater | Brute | Better | Optimal | with INTUITION

Check our Website:
In case you are thinking to buy courses, please check below:
Link to get 20% additional Discount at Coding Ninjas: bit.ly/3wE5aHx
Code "takeuforward" for 15% off at GFG: practice.geeksforgeeks.org/co...
Code "takeuforward" for 20% off on sys-design: get.interviewready.io?_aff=takeuforward
Crypto, I use the Wazirx app: wazirx.com/invite/xexnpc4u
Take 750 rs free Amazon Stock from me: indmoney.onelink.me/RmHC/idje...
Earn 100 rs by making a Grow Account for investing: app.groww.in/v3cO/8hu879t0
Linkedin/Instagram/Telegram: linktr.ee/takeUforward
---------------------------------------------------------------------------------------------------------------------------------------------------- I have decided to make a free placement series comprising of video lectures(C++ and Java) on the entire SDE sheet.. ✅(bit.ly/takeUforward_SDE)
✅Entire Series: bit.ly/placementSeries
✅Problem link: leetcode.com/problems/trappin...
✅This is where I teach: ----- Use coupon-code "TAKEUFORWARD" for getting 10% on my course at GFG: bit.ly/striver_cpCourse
✅Use coupon-code "TAKEUFORWARD" for getting 10% for all GFG courses: bit.ly/tuf_gfgCourse
If you appreciate the channel's work, you can join the family: bit.ly/joinFamily
Thumbnail Creator: / rikonakhuli
✅ Striver's Linkedin Profile: / rajarvp
✅ Instagram: / striver_79
Connect with us: t.me/Competitive_Programming_tuf (Use Link in Mobile only, if not works search "takeUforward" in telegram)..
#dsa #leetcode #placements

Пікірлер: 279

  • @takeUforward
    @takeUforward3 жыл бұрын

    Do leave a comment whether you understood the explanation or not, helps me a lot :) C++ Code Link: github.com/striver79/SDESheet/blob/main/trappingRainWaterC%2B%2B Java Code Link: github.com/striver79/SDESheet/blob/main/trappingRainWaterJava For live session follow at Instagram: instagram.com/striver_79/

  • @parikshitrathore1510

    @parikshitrathore1510

    3 жыл бұрын

    @shashank choudhary he is not making video for growing rather he want to help the community in the best way possible!!...and as we have seen many guus were glad that they use the SDE sheet for there placements so, striver is making the videos so, that sde sheet can be done in less time and more efficiently!!

  • @abhishekranjansingh5348

    @abhishekranjansingh5348

    3 жыл бұрын

    Seriously wanted this video , thanks bhaiya 😘😘😘😌😌😌

  • @suvojitray1431

    @suvojitray1431

    3 жыл бұрын

    great work you have been working real hard for us

  • @vaibhavsethia70

    @vaibhavsethia70

    3 жыл бұрын

    Understood it well.

  • @vishalsannapuri208

    @vishalsannapuri208

    3 жыл бұрын

    Bro only the writing part is not so great so that's the only catch

  • @riteshsrivastava3447
    @riteshsrivastava34472 жыл бұрын

    *if you dont know how to calculate prefix max and suffix max , that is really fine u can learn it and continue doing SDE sheet , if u already know everything then u would not be needing any sheet*

  • @hikikomori9387

    @hikikomori9387

    2 жыл бұрын

    can you please share a useful link for learning prefix max and suffix max ? i would be thankful

  • @vishnuvardhanmalepati7843

    @vishnuvardhanmalepati7843

    2 жыл бұрын

    @@hikikomori9387 didn't find any.. Hence sharing the code for prefix max array and suffix max arrays (in Python) l_max = height[0] r_max = height[-1] n = len(height) prefix_max = [0]*n suffix_max = [0]*n # find the prefix maximum array for i in range(n): l_max = max(height[i],l_max) prefix_max[i] = l_max # find the suffix maximum array for i in range(n-1,-1,-1): r_max = max(height[i],r_max) suffix_max[i] = r_max print(prefix_max) print(suffix_max)

  • @navendraagrawal

    @navendraagrawal

    2 жыл бұрын

    exactly

  • @chetanraghavv

    @chetanraghavv

    2 жыл бұрын

    @@hikikomori9387 think of prefix max array as the array which at any index i contains the max element from index 0 till index i. //prefix max array of array "height" of size n vector left(n,0); left[0] = height[0]; for(int i=1;i=0;i--) right[i] = max(right[i+1], height[i]);

  • @hikikomori9387

    @hikikomori9387

    2 жыл бұрын

    @@chetanraghavv I understand now, thank you so much Chetan bhai

  • @manojpandey7517
    @manojpandey75173 жыл бұрын

    Striver bhai DSA sheet leke aane waale aap pehle aadmi the. Uske baad saare youtubers DSA sheet leke aa rhe. 😂Par ham abhi bhi aapka hi follow krte hain. Ye legacy aapne hi shuru ki thi.

  • @shashankrustagi2812

    @shashankrustagi2812

    3 жыл бұрын

    ye to mujhe pata hi nahi tha lol.

  • @shivamyadav6369

    @shivamyadav6369

    3 жыл бұрын

    Video explanations bhai ka best hai plus voice m jo energy hai na wo jagaa k rkhti h

  • @pranaykumar9433

    @pranaykumar9433

    2 жыл бұрын

    bhai love babbarne laya tha pehle

  • @takeUforward

    @takeUforward

    2 жыл бұрын

    @@pranaykumar9433 na bhai date dekh lo dono videos k

  • @pranaykumar9433

    @pranaykumar9433

    2 жыл бұрын

    Bhaiya word wrap question pr ek video bnaiye plz

  • @shivanimehta5280
    @shivanimehta52803 жыл бұрын

    Had my interview today and coincidentally the interviewer asked me the same problem. Seems like striver knew this beforehand so he dropped this video today only 😄😂

  • @takeUforward

    @takeUforward

    3 жыл бұрын

    XD

  • @511-neelbutani9

    @511-neelbutani9

    3 жыл бұрын

    Which company?

  • @sandeepdass55
    @sandeepdass553 жыл бұрын

    I really wanted to solve this and had optimal solution in mind but was not able to code it. Thanks to you as i searched a lot on youtube but didn't find better explanation than yours! Keep it up and thanks ^_^

  • @manikantabandla3923
    @manikantabandla392311 ай бұрын

    I feel intuition should precede the algorithm always. That's where the skill of problem-solving comes in.

  • @kalpkumudkumar8163
    @kalpkumudkumar81633 жыл бұрын

    took me 2 times to understand intuition but this is best video you can get on this problem , good work .

  • @bhaveshkumar6842
    @bhaveshkumar68422 жыл бұрын

    You are the most effective teacher and I am immensely grateful for your work.

  • @harshtank7075
    @harshtank70753 жыл бұрын

    That optimized explaination with intuition went directly inside my head. Thank you brother 👍

  • @takeUforward

    @takeUforward

    3 жыл бұрын

    Perfect!

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    can you please tell me how to write code to find the prefix and suffix array discuseed in this video ?

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    is this solution under DP ? if yes then why is it under DP ?

  • @krishnasai3367

    @krishnasai3367

    2 жыл бұрын

    @@freshcontent3729 kzread.info/dash/bejne/iqKb07yNgca3Y6g.html&ab_channel=ClubofProgrammers%2CIITBHUVaranasi

  • @manistrikes

    @manistrikes

    2 жыл бұрын

    @@freshcontent3729 making the prefix and suffix sum for further use takes this question to DP dimension...because we are storing the largest element till a particular index for the further use...so it's kind of memoization..dp thing...

  • @santanu29
    @santanu295 ай бұрын

    I got the intuition when you explained the left pointer shifting. Did the rest by myself. Thank you for the video.

  • @piyushkumar-wg8cv
    @piyushkumar-wg8cv Жыл бұрын

    I didn't know what is suffix max and prefix max, but now that I know what is suffix and prefix array I can compute it. I will continue with the SDE sheet also. Don't demotivate.

  • @ritshpatidar
    @ritshpatidar Жыл бұрын

    The hardest part is after coming up with idea that we need to use two pointer. I had the idea but was unable to think, how can I take advantage of two pointers. My thinking says that if you know two pointers can solve this then always try to make values equal. If value at one pointer is less than other, and increment it towards other in order to find greater value.

  • @gandhijainamgunvantkumar6783
    @gandhijainamgunvantkumar67832 жыл бұрын

    the last approach explanation was amazing. Thank you so much brother. :)

  • @datamining4655
    @datamining46553 жыл бұрын

    Why are we checking whether a[l]< a[r]? Isn't it more intuitive to check whether leftMax

  • @kshittizbhardwaj417

    @kshittizbhardwaj417

    3 жыл бұрын

    Yes, you are right you can check that also even I did it the same way. It just depends upon which intuition strikes us first

  • @avinashjha6355
    @avinashjha63553 жыл бұрын

    brother..i am waiting for you to finish all the problems in dsa sheet..you explain very well..please try to bring all the videos fast

  • @SAICHARANREDDYN-wk9zk
    @SAICHARANREDDYN-wk9zk10 ай бұрын

    that intuition that you explained at the end cleared all my doubts and got me a solid understanding! perfect 🥳

  • @prithvigupta8215
    @prithvigupta8215 Жыл бұрын

    9:22 most optimal solution 16:22 intuition

  • @mukulbindal2303
    @mukulbindal23033 жыл бұрын

    Bro, honestly, I will still feel like I am being dishonest to the interviewer. I mean I can't explain this solution to him with a straight face.

  • @takeUforward

    @takeUforward

    3 жыл бұрын

    It's not about how you feel, it's about understanding these things, and keep on solving a new problem every day. if you are able to solve every problem, how will you learn, the more you cannot solve, the more you learn.

  • @mukulbindal2303

    @mukulbindal2303

    3 жыл бұрын

    @@takeUforward it's the fear of getting caught. Thanks btw. : )

  • @takeUforward

    @takeUforward

    3 жыл бұрын

    @@mukulbindal2303 u are not cheating :) even the interviewer knows you have prepared from leetcode. No one expects you to come without preparing so chill out.

  • @mukulbindal2303

    @mukulbindal2303

    3 жыл бұрын

    @@takeUforward Oh.. I didn't know that side.. If that's what it is, then no need to worry. Thanks Raj bro : )

  • @sanjayjoshi8807

    @sanjayjoshi8807

    3 жыл бұрын

    @@takeUforward bhaiya if we are given with the width array also for respective building then we have to compute area ? make a video on it

  • @anupamdubey5736
    @anupamdubey57362 жыл бұрын

    Watched this video after Aditya Verma's for best solution with 2-pointer approach. Although, took some time to understand maxLeft and maxRight parts in 2-pointer but good learning took place. Thanks a lot Raj.♥️

  • @harshagarwal1218
    @harshagarwal12183 жыл бұрын

    Great Explanation! The way u emphasize on the intuition makes it easy to grasp it.

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    is this solution under DP ? if yes then why is it under DP ?

  • @sharanpreetchadha3579
    @sharanpreetchadha35793 жыл бұрын

    Hey, I got the logic of solving the problem like when a[r]

  • @takeUforward

    @takeUforward

    3 жыл бұрын

    I have answered this in the last portion, just before discussing the time complexity. You can watch it once, and let me know if there is till a doubt.

  • @Rajat_maurya
    @Rajat_maurya2 жыл бұрын

    whenever i stuck in a problem i search if u have made any video on that...love u

  • @saichand1940
    @saichand19403 жыл бұрын

    This is the best explanation I can ever find on yt for this problem... respect++;

  • @sbarbeloa
    @sbarbeloa3 жыл бұрын

    Sir hats off to you for the optimal solution. Also wishing you a speedy recovery

  • @JayTharwani
    @JayTharwani2 ай бұрын

    This is a great explanation with patience ! Thank you for sharing .

  • @ghoshdipan
    @ghoshdipan3 жыл бұрын

    GOD LEVEL EXPLAINATION!

  • @sandeepnallala48
    @sandeepnallala483 жыл бұрын

    Hi brother, i am new to this channel.. loved your vedios, In this prblm how can we directly come up with that solution you taught with two pointers, If we are actually seeing the prbln for the frst time?? The Intuition behind it also is not so staight forward?? I think we can think of that approach after seeing someones code or taking external help.. i want to ask onething bro, when u were doing it for the frst time, whether the same prblm with you or you got it right away??

  • @de-codr8814
    @de-codr88143 жыл бұрын

    this is the best explanation available on youtube for this problem .👌👌👍😲

  • @bhavyavijay0
    @bhavyavijay02 жыл бұрын

    how to compute the prefix max and suff max??

  • @vivekpatel6721
    @vivekpatel672110 ай бұрын

    I know striver you will reply to me but still I have a doubt that why have we used here this if condition height[left]

  • @prahladbhadani
    @prahladbhadani2 жыл бұрын

    can't thank you enough for such superb explanation

  • @stith_pragya
    @stith_pragya3 ай бұрын

    Understood....Thank You So Much for this wonderful video..................🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @maneeshkumarpatel9874
    @maneeshkumarpatel98742 жыл бұрын

    That's the awesome solution. Thanks a lot Striver💓

  • @lokeshvikram6192
    @lokeshvikram61923 жыл бұрын

    very well xplained bro.I got the intuition

  • @soumyadebbasu7882
    @soumyadebbasu78823 жыл бұрын

    Thank you Dada for your efforts !

  • @subhamengine1143
    @subhamengine11433 жыл бұрын

    just saw the first 7 min and tried on my own.. and i solved it.. thanks..striver.

  • @yashgoyal7999
    @yashgoyal7999 Жыл бұрын

    wonderful explanation, you explained it so easily, thanks striver🙂🙂

  • @nalingoyal881
    @nalingoyal8814 ай бұрын

    We can always increase l and r when the height[l]

  • @satyamsrivastava.
    @satyamsrivastava.3 жыл бұрын

    This one is amazing.... Very Well explained

  • @RohitSingh-hs4hv
    @RohitSingh-hs4hv2 жыл бұрын

    Thank You Striver For this awesome Sheet

  • @dontknow592
    @dontknow5923 жыл бұрын

    Thank You Sir. Bahot mast samjhaate hain. Aap🔥

  • @sanoferniswan5901
    @sanoferniswan5901Ай бұрын

    Really so helpful to understand better.. Thanks for sharing🎉

  • @saliqgowhar395
    @saliqgowhar395 Жыл бұрын

    you are for sure the best teacher India has ever seen ! 😀

  • @roushanraj8530
    @roushanraj85303 жыл бұрын

    Bhya, explanation is too good, understood 💥💥💯

  • @kage-musha1702
    @kage-musha17023 жыл бұрын

    Solutions and intuition are crystal clear as always bro

  • @manavmohata1240

    @manavmohata1240

    3 жыл бұрын

    All the best!

  • @kage-musha1702

    @kage-musha1702

    3 жыл бұрын

    @@manavmohata1240 Thanks bro All the best for you too :)

  • @mickyman753

    @mickyman753

    3 жыл бұрын

    did you got placed

  • @kage-musha1702

    @kage-musha1702

    3 жыл бұрын

    @@mickyman753 yea its a small company thou , i've got an opportunity as paid intern , if it goes well along they said they'll recruit for full time employee :D :)

  • @mickyman753

    @mickyman753

    3 жыл бұрын

    @@kage-musha1702 All the best buddy , keep going and stay healthy

  • @KishoreKumar-xr3fu
    @KishoreKumar-xr3fu2 жыл бұрын

    Hi bro, could you please share the similar problems or if already shared those links where we can solve with prefix and suffix array(2nd approach in this video)

  • @jitinroy2246

    @jitinroy2246

    2 жыл бұрын

    you can watch anuj bhaiya video on 2nd approach, search tapping rainwater problem on youtube.

  • @freshcontent3729
    @freshcontent37293 жыл бұрын

    is this solution under DP ? if yes then why is it under DP ?

  • @YashHalgaonkar
    @YashHalgaonkar2 жыл бұрын

    I came here only to revise the two pointer method. Time stamps will be very helpful.

  • @-Corvo_Attano
    @-Corvo_Attano Жыл бұрын

    Striver's explanation is always perfect :)

  • @anandkumar.3307
    @anandkumar.33072 жыл бұрын

    finally i understood thanks a lot !!

  • @kunalkhandelwal5782
    @kunalkhandelwal5782 Жыл бұрын

    Such a great explanation...thanks a lot.

  • @rohansinghjr1195
    @rohansinghjr11953 жыл бұрын

    Brother I've seen some of the interviewers don't like,and said that if you know the optimal solution why not came up with it on first approach.... How to tackle that! Thanks in advance

  • @kshittizbhardwaj417

    @kshittizbhardwaj417

    3 жыл бұрын

    did you get any answer?

  • @varunsharma5582

    @varunsharma5582

    2 жыл бұрын

    Don't act like you know the optimal solution, struggle, talk to them, take hints and act like you made the solution based on their hints slowly.

  • @shivalikagupta3433
    @shivalikagupta34332 жыл бұрын

    Extremely well explained!!! :))))

  • @mayurigawande5973
    @mayurigawande59732 жыл бұрын

    You are great man🤗may your all dreams come true😍🙌

  • @gokulreddy709
    @gokulreddy7093 жыл бұрын

    Hey I am new to competitive coding and want to understand time complexity better can you make a video about. It will help me a lot. Thank You

  • @priyankapatil6783
    @priyankapatil678317 күн бұрын

    Hi Raj, Can you please explain about this problem "Interleaving Strings "

  • @anshvashisht8519
    @anshvashisht8519 Жыл бұрын

    7:15 what is prefix and suffix here?

  • @sriramkrishnamurthy4473
    @sriramkrishnamurthy44733 жыл бұрын

    can we use a vector of tuples for taking the input of the elements (provided we are not already provided with the array through reference as a part of function type problems) and modify each element there on to store the values of the left max, the current element and the right max respectively and then compute the area of water stored by each element and then compute the total area as a sum of the individual areas ?

  • @takeUforward

    @takeUforward

    3 жыл бұрын

    yes if not given, but generally you are given an array only. That is how the interview goes, and also if you stores tuples, every index stores 3 elements, then also sc is 3n.

  • @evergreen7781
    @evergreen77812 жыл бұрын

    Legendary explanation !!! Thanks Bhaiya 🧡

  • @RGMUTEX
    @RGMUTEXАй бұрын

    Thanks a lot bro. So nice explanation..❤

  • @aadityakhetan956
    @aadityakhetan9563 жыл бұрын

    Hats off to your efforts 👏 very nicely explained 🙌🙌

  • @ankitkumarmishra5198
    @ankitkumarmishra51983 жыл бұрын

    Brute force approach: class Solution { public: int trap(vector& height) { int ans=0; for(auto i=0;i

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    can you please tell me how to write code to find the prefix and suffix array discuseed in this video ?

  • @avishkarghadge509
    @avishkarghadge5092 жыл бұрын

    Is prefix sum same as prefix max array ? what is suffix max array ? seeing prefix max in code it just probably keeping maximum till known point but same logic couldnt translate to suffix max array Any links to articles ??

  • @prakharagarwal6237
    @prakharagarwal62373 жыл бұрын

    Simply beautiful✨✨ Thanks!

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    is this solution under DP ? if yes then why is it under DP ?

  • @prakharagarwal6237

    @prakharagarwal6237

    3 жыл бұрын

    @@freshcontent3729 no it's not DP

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    @@prakharagarwal6237 then how can we do it using dp ?

  • @sayantaniguha8519
    @sayantaniguha8519 Жыл бұрын

    How does the optimized logic give correct answer for a sorted array ?

  • @-Corvo_Attano

    @-Corvo_Attano

    Жыл бұрын

    if the array is sorted , water will drain to the bottom.

  • @akashvaidsingh
    @akashvaidsingh Жыл бұрын

    One request, it will we very helpful if you add timestamp for each approach.

  • @joydeb8202
    @joydeb82023 жыл бұрын

    Love it !

  • @iamnottech8918
    @iamnottech89184 ай бұрын

    Like omg the optimal solution explanation is of next level

  • @sourabhsisodia9563
    @sourabhsisodia95633 жыл бұрын

    Bhai mjaa aa gya .... Kya samjhaya hain.... Tumhare videos litreally above expectation hote hain...Majaa AA gya striver bhai

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    is this solution under DP ? if yes then why is it under DP ?

  • @sourabhsisodia9563

    @sourabhsisodia9563

    3 жыл бұрын

    @@freshcontent3729 no it's not under dp

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    @@sourabhsisodia9563 then how can i do it using dp ?

  • @sourabhsisodia9563

    @sourabhsisodia9563

    3 жыл бұрын

    @@freshcontent3729 i am just a beginner... Not started learning dp yet....If you want to know then just google it

  • @niitteenpathak8303
    @niitteenpathak83032 жыл бұрын

    Very Good Explanation👏👏👏👏👏👏👏

  • @prasantharavindramesh1078
    @prasantharavindramesh10783 жыл бұрын

    Bro awesome explanation. Just a follow up question. If the bars are of varying width then what will be the approach? Can I use array of struts to store width and height of each bar ?

  • @Kaivalyamani

    @Kaivalyamani

    3 жыл бұрын

    Question remains same ...water stored depends on the height ....and unit can be calculated using formula of rectangle which must be given in the problem

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    is this solution under DP ? if yes then why is it under DP ?

  • @zumazumy2257
    @zumazumy22572 жыл бұрын

    very good explanation .. good job keep going

  • @fromdjangoimport__help__3585
    @fromdjangoimport__help__3585 Жыл бұрын

    use long long for storing ans if u r getting error

  • @parikshitrathore1510
    @parikshitrathore15103 жыл бұрын

    Understood Bhaiya!!😍😍🤩🤩

  • @nishantsrivastava2931
    @nishantsrivastava29313 жыл бұрын

    great video...can u make the videos on the sde sheet section of dp first...just can't wait for such an awesome explanation of dp problems...

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    can you please tell me how to write code to find the prefix and suffix array discuseed in this video ?

  • @OMPRAKASH-fh3so
    @OMPRAKASH-fh3so2 жыл бұрын

    You are genius bhaiya , what a observation 👌👌

  • @krishnabhagat2716
    @krishnabhagat27163 жыл бұрын

    Awesome bhaiya great explanation.

  • @Monkeydluffy-we2fk
    @Monkeydluffy-we2fk2 жыл бұрын

    Ooooooooof what an amazing explanation 😷✌️🔥

  • @rejetimeghavardhan7805
    @rejetimeghavardhan78053 жыл бұрын

    Thanks a lot for the video such a good content understood very well

  • @freshcontent3729

    @freshcontent3729

    3 жыл бұрын

    is this solution under DP ? if yes then why is it under DP ?

  • @rejetimeghavardhan7805

    @rejetimeghavardhan7805

    3 жыл бұрын

    @@freshcontent3729 bro I forgot the solution I will once again go through it and tell the reason

  • @madmax1001
    @madmax10012 жыл бұрын

    Bhai Bhai Bhai Bhai !!! OP Explaination 💖💖 Maza aagya 💯

  • @AbhishekVerma-yw1ps
    @AbhishekVerma-yw1ps7 ай бұрын

    Ye video 20 Dec 2020 ki hai and Love bhaiya ki 14 Oct 2020 ki hai. Iska matlab unki sheet pehle aayi thi

  • @ganapatibiswas5858
    @ganapatibiswas58582 жыл бұрын

    This is Great Explanation

  • @black_shadow4627
    @black_shadow4627 Жыл бұрын

    Thank you striver

  • @shubhankurkumar539
    @shubhankurkumar5393 жыл бұрын

    Thanks!

  • @myyoutubeisthis
    @myyoutubeisthis Жыл бұрын

    Thank you very much sir.

  • @zealkapadiya1096
    @zealkapadiya10963 жыл бұрын

    is it possible that interviewer ask the solution which is using stack?

  • @takeUforward

    @takeUforward

    3 жыл бұрын

    No it does not works like that. It is not a history test :P only problem is given, how you solve depends on you.

  • @prashantraj6366
    @prashantraj63662 жыл бұрын

    I want to share 1 more approach It's a brute force and may lead to undesired triversal but easy to understand int trap(vector& v) { int m=0; for(int k:v){ m=max(k,m); } int ans=0; int st=0,en=v.size(); for(int j=0;j

  • @mantrarajgotecha3055
    @mantrarajgotecha30552 жыл бұрын

    Best explanation ever on youtube :))

  • @parthvaghela7820
    @parthvaghela782011 ай бұрын

    Maza aa gaya bhai. Superb work!!!

  • @codenchill732
    @codenchill7322 жыл бұрын

    great explaination

  • @snehalsamale7404
    @snehalsamale74042 жыл бұрын

    Code provided in the discription giving wrong answer!

  • @nitishsrivastava7040
    @nitishsrivastava70402 жыл бұрын

    man! you are brilliant 😍

  • @dayashankarlakhotia4943
    @dayashankarlakhotia4943 Жыл бұрын

    Very good explanation

  • @pranav288
    @pranav2882 жыл бұрын

    7:20 Went through half the sde sheet understanding everything and bro said you shouldn't do it :(

  • @sreejasree7427
    @sreejasree7427 Жыл бұрын

    best explanation sir , thankyou

  • @tanmaychandra9434
    @tanmaychandra94343 жыл бұрын

    Bhaiya kya aap CodeForces and CodeChef ke solutions ke upar regular video bna sktey ho kya ?

  • @Ace-ex9gg
    @Ace-ex9gg Жыл бұрын

    calculating suffix and prefix is one of the most basic question . I don't know why people complain about this sheet. Striver is a 6* coder and just imagine how would he feel about wasting time on that prefix and suffix.!!!!

  • @aniketsinghvats767
    @aniketsinghvats7672 жыл бұрын

    Thank you so much sir🥺🥺🥺🥺🥺

  • @mayurigawande5973
    @mayurigawande59732 жыл бұрын

    Thanks bro😍🤗

  • @HeavenRoasts
    @HeavenRoasts3 жыл бұрын

    Striver bhaiya op 🔥🔥🔥