Sum of Subarray Minimums | Detailed | Leetcode 907

  Рет қаралды 26,011

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 273
@varunbhargavmoori7815
@varunbhargavmoori7815 Жыл бұрын
This is the only perfect video for this problem in the whole internet.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much ❤️
@lalitk
@lalitk Жыл бұрын
Right 😊😊😊❤❤
@sehajdhawan580
@sehajdhawan580 Жыл бұрын
Right I watched so many videos before coming to this due to its length 😅
@technologicalvivek7510
@technologicalvivek7510 8 ай бұрын
@@sehajdhawan580 Right
@gui-codes
@gui-codes 4 ай бұрын
agree
@harikuduva
@harikuduva 10 ай бұрын
I don't even speak hindi and I understood your explanation more than those other videos explaining in english. Great work.
@aws_handles
@aws_handles 10 ай бұрын
😮😮😮
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
You made my day. Thank you so much ❤️❤️🙏🙏
@footballcreativeeverywhere260
@footballcreativeeverywhere260 10 ай бұрын
East or west hindi is the best❤️😂
@RajanSingh-xr7cf
@RajanSingh-xr7cf 2 ай бұрын
oh angrej ke chode ................ jyada gyan mt de bhai ko hindi aati ni haii ....
@aryansinha1818
@aryansinha1818 9 ай бұрын
Man who are you, "Best explainer I guess". How can you explain so good. Hats off to you. Thank you from bottom of my heart. Love and respect always. It felt like I am binge watching Netflix. It was that smooth and crisp and clear.
@dumbstonks
@dumbstonks 2 ай бұрын
Bhai don't ever stop uploading such detailed intuitive videos, these are like finding gems in a junkyard
@nagmakhan672
@nagmakhan672 2 жыл бұрын
There is literally no video which gone to this depth for this Qn Thanks a lot 😊
@ramprasath3818
@ramprasath3818 10 ай бұрын
This channel is gold. The way he explains it step by step by walking through what he thinks, is really great. And I don't even know Hindi lol. Thanks a lot.
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Thank you 😇🙏❤️
@Gameplaywithmr
@Gameplaywithmr 2 жыл бұрын
bahut clear hai concept is video ke baad, thanks you so much. shaandar jabardust dindabaad😀
@codestorywithMIK
@codestorywithMIK 2 жыл бұрын
Thank you 😇🙏
@pranavkhatri30
@pranavkhatri30 2 жыл бұрын
Till now, I have watched multiple videos for this concept. Couldn't find better explanation than this. Worth watching!
@codestorywithMIK
@codestorywithMIK 2 жыл бұрын
Thank you so much Pranav ❤️❤️❤️
@Rajsingh-bh4qw
@Rajsingh-bh4qw Жыл бұрын
literally i watched so many videos but couldnt find a better explanation than this one. Thanks a lot sir🙏🙏🙏 each and every doubt is clear and also the edge cases.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you Raj 😇💕
@technologicalvivek7510
@technologicalvivek7510 8 ай бұрын
mene 3,4 videos dekhe youtube pe iss question ka point of view samajhne ke liye but ek bhi youtuber depth me bata nhi paye ,jis depth me aapne bataya. Thank you.
@codestorywithMIK
@codestorywithMIK 8 ай бұрын
❤️🙏
@shadowgamer8105
@shadowgamer8105 4 ай бұрын
Sir love you dil se sachhi bole rahe hai aapke jaisa bhot kam log free mein intuition provide krta hai literally thank you sir 👌👌
@codestorywithMIK
@codestorywithMIK 2 жыл бұрын
If you are wondering how we come up with the formula at 12:06 - Let's take an example shown below : _, _, _, 2, _, _ If you notice- No. of ways to start our subarray from left of 2 (including 2) is = 4 (i.e. we have 4 possible starting points) No. of ways to end our subarray at right of 2 (including 2) is = 3 (i.e. we have 3 possible endings for our subarray) As per above two equations, For each starting point we have 3 ending points possible Total = 4*3 = 12
@RaviTeja-cq6pu
@RaviTeja-cq6pu Жыл бұрын
_, _, _, 2, _, _ how is it possible to start from 2. could you please explain.......
@anuragv400
@anuragv400 11 ай бұрын
@@RaviTeja-cq6pu take one scenario where you started and ended on 2.
@fettuccine794
@fettuccine794 10 ай бұрын
This is the exact thing I was searching for in the entire internet, thank you So much ❤❤❤❤
@10minutes_cs
@10minutes_cs 10 ай бұрын
still if u find it confusing , here is simple derivation. let the number of elements before given element (eg: 2) be "b", and after given element (eg: 2) be "a", so , total number of subarray will be b // [3,4,5, 2] , [4,,5,2] , [5,2] a // [2,3,4], [2,3] 1 // [2] b*a // 9:07 cases so equation is b + a + 1 + (b*a) .. if u solve this its equal to (b+1)*(a+1)
@gui-codes
@gui-codes 4 ай бұрын
Bekar hi itne videos dekhe. Pehle hi is channel me ajana chaie tha. Bhai tumse acha isko koi nahi explain kar sakta. hats off to you
@anddevsahil
@anddevsahil Ай бұрын
I got stuck on this edge case only while coding . Thanks man for clearing the doubt.
@wearevacationuncoverers
@wearevacationuncoverers Жыл бұрын
This is the only best explanation I found for this problem. You are too good. Let's support this Legend and make him famous.
@eng.gaming5557
@eng.gaming5557 10 ай бұрын
Perfection belongs to one and only Mazhar Khan Sir... Thanks for ur efforts
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
❤️❤️🙏🙏means a lot
@sayantanpoddar5428
@sayantanpoddar5428 10 ай бұрын
I search all over internet for those videos which have brute force solution .....and after that i found this channel and here only i got step by step thinking towards optimal solution ............near about 60 days i follow this channel and explainations are really great
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Means a lot ❤️❤️🙏🙏
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Means a lot ❤️❤️🙏🙏
@DevOpskagyaan
@DevOpskagyaan Жыл бұрын
No one, I repeat no one can teach like this LEGEND
@Danish-saifi1
@Danish-saifi1 Жыл бұрын
You are creating a gold mine for future programmers ❤❤ loved the way of explanations Zero rote learning only concept ❤
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much ❤️
@souravjoshi2293
@souravjoshi2293 2 жыл бұрын
First , your voice just makes me feel that the Qn is too easy and the way you explain , everything seems so effortless.I am still speechless with the amount of effort you put in a video. Thanks and congratulations for being such an impactful tutor. I can sense of urge in your voice to transfer the knowledge to us. People will soon start knowing you from this channel. Thanks from me and my friends in college who have started following you ❣
@codestorywithMIK
@codestorywithMIK 2 жыл бұрын
This comment made my day. Thanks a lot ❤️❤️❤️
@shikharmalik3787
@shikharmalik3787 2 жыл бұрын
this guy got some great voice...every question feels easy after that///
@ankitgupta7467
@ankitgupta7467 5 ай бұрын
That's called a mindblowing explanation!!! Amazed at How I stayed here for 49 minutes, It was worthwhile.
@rounaq_khandelwal
@rounaq_khandelwal Жыл бұрын
You are absolutely right, others have directly written the code w/o proper explaination!! Thanks a lot Mik Bhai for this wonderful video
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much 😇❤️🙏🙏
@jagdishkhetre4515
@jagdishkhetre4515 3 ай бұрын
Thank you so much for detailed Explaination ...[ Formula :-> i - NSL[i] * NSR[i] - i ]
@tsukuruuu
@tsukuruuu Жыл бұрын
Great content as usual. Whenever i search any question and notice that you have made a video on that, i immediately click on it without a second doubt , no matter how long the video. Please don't stop making and uploading such videos! You truly are a gem! Thank you sm!
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much. Means a lot to me 😇🙏
@theshlok
@theshlok 10 ай бұрын
Probably the only video which is able to actually explain the intuition behind this problem.
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
❤️❤️🙏🏻🙏🏻
@jayashankarmaddipoti6964
@jayashankarmaddipoti6964 10 ай бұрын
As usual, I was able to solve using a brute force approach and received a time limit exceeded error. No one born with enormous reasoning/analytical skills so as I. No need to worry, check who else solved the problem before, understand the approach and follow it. There is no mistake in following others when you are not sure. Thanks, MIK bro. No stop to learning. One day, I will become a pro of programming.
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Definitely 💪💪💪 Keep going 🔥
@riyadhossain1706
@riyadhossain1706 Жыл бұрын
Literally, amazed by the way you elaborate on the solution.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Means a lot Thank you 😇❤️
@aadarshdontul5732
@aadarshdontul5732 5 ай бұрын
Intuition.... is the main thing that way you have explained.
@rahulkumarsingh4021
@rahulkumarsingh4021 8 күн бұрын
what an explanation.Finally I was able to understand the solution .thank you bro.
@harshitgupta8089
@harshitgupta8089 Жыл бұрын
Bhaiya I love you Your way of explaination is awesome I GOT THE BEST EXPLAINATION HERE FINALLY
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so so much ❤️❤️
@Raj10185
@Raj10185 Жыл бұрын
This question is really amazing bas observation jaise kiya nsl and nsr se ho jyega bas question is very much standard bas formula figure out me thoda dikkat hua baki ab sab smoothly solve ho gya.
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
indeed
@Abhay14
@Abhay14 10 ай бұрын
thanks a lot bhaiya , sayad hi aapse acchha koi iss question ko samjha skta tha this topic was so deep and interested
@nikhilsatyam4815
@nikhilsatyam4815 10 ай бұрын
awesome exlaination after striver you are the best tutor on youtube for dsa.
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
❤️🙏
@shristisrivastava7054
@shristisrivastava7054 2 ай бұрын
You always explain the logic so well. Hats off to you!
@Kings-ik9lh
@Kings-ik9lh 10 ай бұрын
we can also check left and right elements at the travrsal time of index also but it will take Time complexity O(N^2) but space complexity will be O(1) int mod = 1e9 + 7; int sumSubarrayMins(vector& arr) { long long ans = 0; for(int i=0;i=0 && arr[j]>=temp){ leftcount++; j--; } int k = i + 1; long long rightcount = 0; while(ktemp){ rightcount++; k++; } ans=(ans%mod+(leftcount+1)%mod*(rightcount+1)%mod*temp%mod)%mod; } return (ans % mod);
@Afiniciado
@Afiniciado 3 ай бұрын
best explanation found so far!!!
@aadil4236
@aadil4236 4 ай бұрын
Very Good explanation brother. I was only able to get it after watching your explanation. Kudos to you!
@amlantribedi7954
@amlantribedi7954 11 ай бұрын
By Far the best Explanation in KZbin !
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
It means a lot. Thank you so much 🙏😇
@NikhilRaj-wv6nf
@NikhilRaj-wv6nf Жыл бұрын
Mik, explained the entire concept with 50 min video lecture >
@codestorywithMIK
@codestorywithMIK Жыл бұрын
❤️❤️❤️
@adityatomar9820
@adityatomar9820 9 ай бұрын
god level explanation bhaii...i was struggling so much in this ques
@robot3.077
@robot3.077 8 ай бұрын
best explanation on youtube. fell in love with your explanation🙏🙏😍😍
@codestorywithMIK
@codestorywithMIK 8 ай бұрын
🙏🙏❤️❤️
@AMANRAJ-dt8gu
@AMANRAJ-dt8gu 2 ай бұрын
The nicest explanation I have got as compared to other videos. Doing great job man🙏
@shrijonbiswas8105
@shrijonbiswas8105 Жыл бұрын
U are a genius..keep making videos for such lesser known problems
@codestorywithMIK
@codestorywithMIK Жыл бұрын
It means a lot 🙏🙏❤️❤️😇😇 Sure I will be posting more
@itssumit6161
@itssumit6161 7 ай бұрын
You are just awesome sir u made the question more easy with your explanation. ❤
@AnjuGupta-sz1uk
@AnjuGupta-sz1uk 10 ай бұрын
very clear explanation for each and every point of the problem...bhaiya your explanation is crystal clear ,like no need to go for any other videos for understanding the concept after watching your video.
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Means a lot. ☺
@tusharbhatia5437
@tusharbhatia5437 10 ай бұрын
Beautiful explanation. Was able to code myself after your explanation itself thanks !
@TejalKumawat-hu9yi
@TejalKumawat-hu9yi 7 ай бұрын
best explaination on the internet for this question
@codestorywithMIK
@codestorywithMIK 7 ай бұрын
Thank you ❤️
@rahulverma9237
@rahulverma9237 Жыл бұрын
beautifully explained, solved the sum of subarray ranges question by this method, keep up the good work
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much 😇❤️🙏
@geekieyyy
@geekieyyy Жыл бұрын
your explanation is awesome , I understood in one go,, It's better to watch one video of 50 minutes in detail rather than 5 to 6 videos of each 20 mins.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much ❤️😇🙏
@tryin_to_code
@tryin_to_code 5 ай бұрын
I tried to do this question using Sliding Window technique and following is the code that I have written : class Solution { public: int sumSubarrayMins(vector& arr) { vector result; deque deq; int n = arr.size(); int k = 1; while(k
@niteshk0487
@niteshk0487 Жыл бұрын
Bhai God Level explanation❤✅
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Nitesh ❤️❤️❤️
@it17harshahuja81
@it17harshahuja81 Жыл бұрын
Liked only because of the Edge Case👍👍👍👍
@shivamnirmalkar6251
@shivamnirmalkar6251 4 ай бұрын
//vector getNSL(vector& arr, int n) , bhaiya aapne yaha NSL likh rakha hai or aap for loop se travel kr rhe right side //for(int i = 0; i
@subhamoysasmal8382
@subhamoysasmal8382 2 ай бұрын
sir you are simply great
@RV-qf1iz
@RV-qf1iz Жыл бұрын
thanks bro i was able to solve this problem on my own after understanding the logic.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Glad to hear that 😇❤️🙏
@oknokok
@oknokok Ай бұрын
Best explanation
@thekindspill
@thekindspill Жыл бұрын
One of the best explanations
@rajubali5627
@rajubali5627 2 ай бұрын
super sir...this is perfect explanation......
@gauravbanerjee2898
@gauravbanerjee2898 10 ай бұрын
Thanks a lot bhaiya ❣️ this was the best explanation for this question among all of the other explanations I have seen so far
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Most welcome 😊
@RajanSingh-xr7cf
@RajanSingh-xr7cf 2 ай бұрын
sach mai great explation _____________
@gocrazy6177
@gocrazy6177 Жыл бұрын
How can someone be so good at explaning logics ??
@codestorywithMIK
@codestorywithMIK Жыл бұрын
🙏🙏🙏❤️❤️❤️
@gocrazy6177
@gocrazy6177 Жыл бұрын
@@codestorywithMIK 🙏🙏🙏 bless me sir
@pankaj_2003
@pankaj_2003 9 ай бұрын
best explaination i hv got fr this question ,thankyou so much ........
@raisanjeeb42
@raisanjeeb42 Жыл бұрын
What an explanation Loved it how you built the intuition...So simple and easy to understand Thanks
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much ❤️❤️❤️
@raisanjeeb42
@raisanjeeb42 Жыл бұрын
@@codestorywithMIK If u get time..Please make solutions on leetcode contests. You're explanations are so helpful
@codestorywithMIK
@codestorywithMIK Жыл бұрын
@raisanjeeb42 sure thing Sanjeeb. I am soon planning to take out time for that Thank you for understanding ❤️❤️❤️
@raisanjeeb42
@raisanjeeb42 Жыл бұрын
@@codestorywithMIK Much Appreciated for your reply and taking time to make this wonderful explanations
@footballcreativeeverywhere260
@footballcreativeeverywhere260 10 ай бұрын
Great mik bhai❤
@anveshasharma2726
@anveshasharma2726 6 ай бұрын
very nyc explaination. support from haryana
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
🙏🙏❤️❤️😊😊
@VedBrahmbhattBEE
@VedBrahmbhattBEE 10 ай бұрын
Best Explanation for this problem!! Thanks Sir : )
@ankitasantape1063
@ankitasantape1063 10 ай бұрын
Thanks a lot Sir for this wonderful in depth explanation.
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
You are most welcome 🙏
@sz.110
@sz.110 Жыл бұрын
*New Test cases Has Been Added* Overflow aaraha hai toh *long long* ka use karein
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks Sajjad ❤️❤️
@this_is_ur_ms
@this_is_ur_ms 8 ай бұрын
Great Explanation, cleared everything. Thankyou.
@chillkro25
@chillkro25 10 ай бұрын
One of the finest explanation ❤
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Thanks a lot 😊
@chillkro25
@chillkro25 10 ай бұрын
@@codestorywithMIK 🙏🙏🙏
@chiragsharma8905
@chiragsharma8905 11 ай бұрын
Subscribed❤. Loved the explanation.
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
Thank you so much ❤️❤️🙏🙏
@vishalgaurav4193
@vishalgaurav4193 10 ай бұрын
Now I finally subscribed your channel after this great explanation👍.Really impressed with the way you explain this problem easily
@ritikabisht2055
@ritikabisht2055 8 ай бұрын
Really nice and detailed explanation ❤
@viidhudubey8573
@viidhudubey8573 Жыл бұрын
very well and thoroughly explained, Thank you for this
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much 😇❤️
@dayashankarlakhotia4943
@dayashankarlakhotia4943 Жыл бұрын
Very beautiful explanation and much intuitive thanks
@codestorywithMIK
@codestorywithMIK Жыл бұрын
You're most welcome 😇
@arthurlewin1952
@arthurlewin1952 2 жыл бұрын
Amazing explaination sir solve largest rectangular area of histogram using this
@codestorywithMIK
@codestorywithMIK 2 жыл бұрын
Sure Arthur. Thanks a lot I will soon upload Histogram one
@reemakumari9495
@reemakumari9495 Жыл бұрын
love you sir ...finally abb samajh aaya
@bhuppidhamii
@bhuppidhamii 10 ай бұрын
corner case 35:35
@satyamkumaryadav1560
@satyamkumaryadav1560 Жыл бұрын
as soon as i saw this problem i came to your video and as you told we need to find left smallest nearest aditya verma striked op mik you are op one hint : if you find two loops being used i being the outer loop j being the inner loop if j is dependent on i think of stack as in this question
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much ❤️❤️❤️
@SamsIt-hi9gf
@SamsIt-hi9gf 5 ай бұрын
bhai your explaination is op....
@nitingoel258
@nitingoel258 7 ай бұрын
Very well explanation !
@joydeep-halder
@joydeep-halder 10 ай бұрын
Such a detailed explanation! Hats Off 🔥🔥 Earned a subscriber!
@varunsheth1003
@varunsheth1003 2 жыл бұрын
Nice Explanation
@thestrangers6433
@thestrangers6433 5 ай бұрын
Best on youtube ❤
@SurajKumar-ku1lg
@SurajKumar-ku1lg 6 ай бұрын
best video explanation of that problem
@vishalanand878
@vishalanand878 22 күн бұрын
superb explanation🔥🔥🔥🔥🔥🔥
@footballalliance2412
@footballalliance2412 9 ай бұрын
Thank you so much sir, now i got the intuition.
@ashutoshsingh285
@ashutoshsingh285 Ай бұрын
bhai you are legend ho.
@dhruvaseri2082
@dhruvaseri2082 3 ай бұрын
great work...
@NatureLover-oq6uc
@NatureLover-oq6uc Жыл бұрын
Great explanation....
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much 😊
@medhanshagrawal5787
@medhanshagrawal5787 6 ай бұрын
Just Perfect Broo. Loved it❤
@ugcwithaddi
@ugcwithaddi 10 ай бұрын
Dope explanation Best one on internet 🔥
@md.tamaltahasinkhan6448
@md.tamaltahasinkhan6448 10 ай бұрын
what a detailed explanation!!! ❤
@bhuppidhamii
@bhuppidhamii 10 ай бұрын
when i did this Q's 3-4 weeks ago I fully understood it. but now today when i'm doing POTD I still cannot able to come back that stack will be used in this Q's. Why is it happening, what to do to prevent this?
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Hi there, It happens with me also. Don’t worry. I usually either try it for 30 minutes, if I don’t get it, i watch the solution and try to figure what exactly i was missing. Remember one thing : For any qn, firstly try the worst solution- Brute Force, then go to optimal. It helps you understand what was the reason that was causing the high time complexity in brute force, what exactly we should improve to make it optimal. This helps a lot. And keep practising more and more.
@bhuppidhamii
@bhuppidhamii 10 ай бұрын
@@codestorywithMIK thank you for your kind words
@akshatmishra9574
@akshatmishra9574 5 ай бұрын
That Was Damn Clean and Good Explanation Bro !!
@ss8273
@ss8273 Жыл бұрын
thank you sir keep it up really helpful........😍😍
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Most welcome❤️❤️
@sjxsubham...
@sjxsubham... 10 ай бұрын
best.... solution... thank MIK sir
@MakeuPerfect
@MakeuPerfect 2 жыл бұрын
You are superb
@codestorywithMIK
@codestorywithMIK 2 жыл бұрын
Thank you so much ❤️❤️❤️
@deveshsharma-u2l
@deveshsharma-u2l 8 ай бұрын
thanks bro loved it !Thanks😘😘😘😘😘😍 Enjoyed it Dil de
@iayushsharma
@iayushsharma 5 ай бұрын
Thankyou Mik for awesome content
Implement Queue using Stacks | Amortised O(1) | Leetcode 232 | Google
21:40
How to Fight a Gross Man 😡
00:19
Alan Chikin Chow
Рет қаралды 17 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 149 МЛН
Machine Learning for Everybody - Full Course
3:53:53
freeCodeCamp.org
Рет қаралды 8 МЛН
C Programming Tutorial for Beginners
3:46:13
freeCodeCamp.org
Рет қаралды 14 МЛН
Sum of Subarray Minimums - Leetcode 907 - Python
18:51
NeetCodeIO
Рет қаралды 35 М.
How to Fight a Gross Man 😡
00:19
Alan Chikin Chow
Рет қаралды 17 МЛН