This is the only perfect video for this problem in the whole internet.
@codestorywithMIK Жыл бұрын
Thank you so much ❤️
@lalitk Жыл бұрын
Right 😊😊😊❤❤
@sehajdhawan580 Жыл бұрын
Right I watched so many videos before coming to this due to its length 😅
@technologicalvivek75108 ай бұрын
@@sehajdhawan580 Right
@gui-codes4 ай бұрын
agree
@harikuduva10 ай бұрын
I don't even speak hindi and I understood your explanation more than those other videos explaining in english. Great work.
@aws_handles10 ай бұрын
😮😮😮
@codestorywithMIK10 ай бұрын
You made my day. Thank you so much ❤️❤️🙏🙏
@footballcreativeeverywhere26010 ай бұрын
East or west hindi is the best❤️😂
@RajanSingh-xr7cf2 ай бұрын
oh angrej ke chode ................ jyada gyan mt de bhai ko hindi aati ni haii ....
@aryansinha18189 ай бұрын
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.
@dumbstonks2 ай бұрын
Bhai don't ever stop uploading such detailed intuitive videos, these are like finding gems in a junkyard
@nagmakhan6722 жыл бұрын
There is literally no video which gone to this depth for this Qn Thanks a lot 😊
@ramprasath381810 ай бұрын
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.
@codestorywithMIK10 ай бұрын
Thank you 😇🙏❤️
@Gameplaywithmr2 жыл бұрын
bahut clear hai concept is video ke baad, thanks you so much. shaandar jabardust dindabaad😀
@codestorywithMIK2 жыл бұрын
Thank you 😇🙏
@pranavkhatri302 жыл бұрын
Till now, I have watched multiple videos for this concept. Couldn't find better explanation than this. Worth watching!
@codestorywithMIK2 жыл бұрын
Thank you so much Pranav ❤️❤️❤️
@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 Жыл бұрын
Thank you Raj 😇💕
@technologicalvivek75108 ай бұрын
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.
@codestorywithMIK8 ай бұрын
❤️🙏
@shadowgamer81054 ай бұрын
Sir love you dil se sachhi bole rahe hai aapke jaisa bhot kam log free mein intuition provide krta hai literally thank you sir 👌👌
@codestorywithMIK2 жыл бұрын
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 Жыл бұрын
_, _, _, 2, _, _ how is it possible to start from 2. could you please explain.......
@anuragv40011 ай бұрын
@@RaviTeja-cq6pu take one scenario where you started and ended on 2.
@fettuccine79410 ай бұрын
This is the exact thing I was searching for in the entire internet, thank you So much ❤❤❤❤
@10minutes_cs10 ай бұрын
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-codes4 ай бұрын
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Ай бұрын
I got stuck on this edge case only while coding . Thanks man for clearing the doubt.
@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.gaming555710 ай бұрын
Perfection belongs to one and only Mazhar Khan Sir... Thanks for ur efforts
@codestorywithMIK10 ай бұрын
❤️❤️🙏🙏means a lot
@sayantanpoddar542810 ай бұрын
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
@codestorywithMIK10 ай бұрын
Means a lot ❤️❤️🙏🙏
@codestorywithMIK10 ай бұрын
Means a lot ❤️❤️🙏🙏
@DevOpskagyaan Жыл бұрын
No one, I repeat no one can teach like this LEGEND
@Danish-saifi1 Жыл бұрын
You are creating a gold mine for future programmers ❤❤ loved the way of explanations Zero rote learning only concept ❤
@codestorywithMIK Жыл бұрын
Thank you so much ❤️
@souravjoshi22932 жыл бұрын
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 ❣
@codestorywithMIK2 жыл бұрын
This comment made my day. Thanks a lot ❤️❤️❤️
@shikharmalik37872 жыл бұрын
this guy got some great voice...every question feels easy after that///
@ankitgupta74675 ай бұрын
That's called a mindblowing explanation!!! Amazed at How I stayed here for 49 minutes, It was worthwhile.
@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 Жыл бұрын
Thank you so much 😇❤️🙏🙏
@jagdishkhetre45153 ай бұрын
Thank you so much for detailed Explaination ...[ Formula :-> i - NSL[i] * NSR[i] - i ]
@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 Жыл бұрын
Thank you so much. Means a lot to me 😇🙏
@theshlok10 ай бұрын
Probably the only video which is able to actually explain the intuition behind this problem.
@codestorywithMIK10 ай бұрын
❤️❤️🙏🏻🙏🏻
@jayashankarmaddipoti696410 ай бұрын
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.
@codestorywithMIK10 ай бұрын
Definitely 💪💪💪 Keep going 🔥
@riyadhossain1706 Жыл бұрын
Literally, amazed by the way you elaborate on the solution.
@codestorywithMIK Жыл бұрын
Means a lot Thank you 😇❤️
@aadarshdontul57325 ай бұрын
Intuition.... is the main thing that way you have explained.
@rahulkumarsingh40218 күн бұрын
what an explanation.Finally I was able to understand the solution .thank you bro.
@harshitgupta8089 Жыл бұрын
Bhaiya I love you Your way of explaination is awesome I GOT THE BEST EXPLAINATION HERE FINALLY
@codestorywithMIK Жыл бұрын
Thank you so so much ❤️❤️
@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.
@codestorywithMIK10 ай бұрын
indeed
@Abhay1410 ай бұрын
thanks a lot bhaiya , sayad hi aapse acchha koi iss question ko samjha skta tha this topic was so deep and interested
@nikhilsatyam481510 ай бұрын
awesome exlaination after striver you are the best tutor on youtube for dsa.
@codestorywithMIK10 ай бұрын
❤️🙏
@shristisrivastava70542 ай бұрын
You always explain the logic so well. Hats off to you!
@Kings-ik9lh10 ай бұрын
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);
@Afiniciado3 ай бұрын
best explanation found so far!!!
@aadil42364 ай бұрын
Very Good explanation brother. I was only able to get it after watching your explanation. Kudos to you!
@amlantribedi795411 ай бұрын
By Far the best Explanation in KZbin !
@codestorywithMIK11 ай бұрын
It means a lot. Thank you so much 🙏😇
@NikhilRaj-wv6nf Жыл бұрын
Mik, explained the entire concept with 50 min video lecture >
@codestorywithMIK Жыл бұрын
❤️❤️❤️
@adityatomar98209 ай бұрын
god level explanation bhaii...i was struggling so much in this ques
@robot3.0778 ай бұрын
best explanation on youtube. fell in love with your explanation🙏🙏😍😍
@codestorywithMIK8 ай бұрын
🙏🙏❤️❤️
@AMANRAJ-dt8gu2 ай бұрын
The nicest explanation I have got as compared to other videos. Doing great job man🙏
@shrijonbiswas8105 Жыл бұрын
U are a genius..keep making videos for such lesser known problems
@codestorywithMIK Жыл бұрын
It means a lot 🙏🙏❤️❤️😇😇 Sure I will be posting more
@itssumit61617 ай бұрын
You are just awesome sir u made the question more easy with your explanation. ❤
@AnjuGupta-sz1uk10 ай бұрын
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.
@codestorywithMIK10 ай бұрын
Means a lot. ☺
@tusharbhatia543710 ай бұрын
Beautiful explanation. Was able to code myself after your explanation itself thanks !
@TejalKumawat-hu9yi7 ай бұрын
best explaination on the internet for this question
@codestorywithMIK7 ай бұрын
Thank you ❤️
@rahulverma9237 Жыл бұрын
beautifully explained, solved the sum of subarray ranges question by this method, keep up the good work
@codestorywithMIK Жыл бұрын
Thank you so much 😇❤️🙏
@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 Жыл бұрын
Thank you so much ❤️😇🙏
@tryin_to_code5 ай бұрын
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 Жыл бұрын
Bhai God Level explanation❤✅
@codestorywithMIK Жыл бұрын
Thanks a lot Nitesh ❤️❤️❤️
@it17harshahuja81 Жыл бұрын
Liked only because of the Edge Case👍👍👍👍
@shivamnirmalkar62514 ай бұрын
//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
@subhamoysasmal83822 ай бұрын
sir you are simply great
@RV-qf1iz Жыл бұрын
thanks bro i was able to solve this problem on my own after understanding the logic.
@codestorywithMIK Жыл бұрын
Glad to hear that 😇❤️🙏
@oknokokАй бұрын
Best explanation
@thekindspill Жыл бұрын
One of the best explanations
@rajubali56272 ай бұрын
super sir...this is perfect explanation......
@gauravbanerjee289810 ай бұрын
Thanks a lot bhaiya ❣️ this was the best explanation for this question among all of the other explanations I have seen so far
@codestorywithMIK10 ай бұрын
Most welcome 😊
@RajanSingh-xr7cf2 ай бұрын
sach mai great explation _____________
@gocrazy6177 Жыл бұрын
How can someone be so good at explaning logics ??
@codestorywithMIK Жыл бұрын
🙏🙏🙏❤️❤️❤️
@gocrazy6177 Жыл бұрын
@@codestorywithMIK 🙏🙏🙏 bless me sir
@pankaj_20039 ай бұрын
best explaination i hv got fr this question ,thankyou so much ........
@raisanjeeb42 Жыл бұрын
What an explanation Loved it how you built the intuition...So simple and easy to understand Thanks
@codestorywithMIK Жыл бұрын
Thank you so much ❤️❤️❤️
@raisanjeeb42 Жыл бұрын
@@codestorywithMIK If u get time..Please make solutions on leetcode contests. You're explanations are so helpful
@codestorywithMIK Жыл бұрын
@raisanjeeb42 sure thing Sanjeeb. I am soon planning to take out time for that Thank you for understanding ❤️❤️❤️
@raisanjeeb42 Жыл бұрын
@@codestorywithMIK Much Appreciated for your reply and taking time to make this wonderful explanations
@footballcreativeeverywhere26010 ай бұрын
Great mik bhai❤
@anveshasharma27266 ай бұрын
very nyc explaination. support from haryana
@codestorywithMIK6 ай бұрын
🙏🙏❤️❤️😊😊
@VedBrahmbhattBEE10 ай бұрын
Best Explanation for this problem!! Thanks Sir : )
@ankitasantape106310 ай бұрын
Thanks a lot Sir for this wonderful in depth explanation.
@codestorywithMIK10 ай бұрын
You are most welcome 🙏
@sz.110 Жыл бұрын
*New Test cases Has Been Added* Overflow aaraha hai toh *long long* ka use karein
@codestorywithMIK Жыл бұрын
Thanks Sajjad ❤️❤️
@this_is_ur_ms8 ай бұрын
Great Explanation, cleared everything. Thankyou.
@chillkro2510 ай бұрын
One of the finest explanation ❤
@codestorywithMIK10 ай бұрын
Thanks a lot 😊
@chillkro2510 ай бұрын
@@codestorywithMIK 🙏🙏🙏
@chiragsharma890511 ай бұрын
Subscribed❤. Loved the explanation.
@codestorywithMIK11 ай бұрын
Thank you so much ❤️❤️🙏🙏
@vishalgaurav419310 ай бұрын
Now I finally subscribed your channel after this great explanation👍.Really impressed with the way you explain this problem easily
@ritikabisht20558 ай бұрын
Really nice and detailed explanation ❤
@viidhudubey8573 Жыл бұрын
very well and thoroughly explained, Thank you for this
@codestorywithMIK Жыл бұрын
Thank you so much 😇❤️
@dayashankarlakhotia4943 Жыл бұрын
Very beautiful explanation and much intuitive thanks
@codestorywithMIK Жыл бұрын
You're most welcome 😇
@arthurlewin19522 жыл бұрын
Amazing explaination sir solve largest rectangular area of histogram using this
@codestorywithMIK2 жыл бұрын
Sure Arthur. Thanks a lot I will soon upload Histogram one
@reemakumari9495 Жыл бұрын
love you sir ...finally abb samajh aaya
@bhuppidhamii10 ай бұрын
corner case 35:35
@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 Жыл бұрын
Thank you so much ❤️❤️❤️
@SamsIt-hi9gf5 ай бұрын
bhai your explaination is op....
@nitingoel2587 ай бұрын
Very well explanation !
@joydeep-halder10 ай бұрын
Such a detailed explanation! Hats Off 🔥🔥 Earned a subscriber!
@varunsheth10032 жыл бұрын
Nice Explanation
@thestrangers64335 ай бұрын
Best on youtube ❤
@SurajKumar-ku1lg6 ай бұрын
best video explanation of that problem
@vishalanand87822 күн бұрын
superb explanation🔥🔥🔥🔥🔥🔥
@footballalliance24129 ай бұрын
Thank you so much sir, now i got the intuition.
@ashutoshsingh285Ай бұрын
bhai you are legend ho.
@dhruvaseri20823 ай бұрын
great work...
@NatureLover-oq6uc Жыл бұрын
Great explanation....
@codestorywithMIK Жыл бұрын
Thank you so much 😊
@medhanshagrawal57876 ай бұрын
Just Perfect Broo. Loved it❤
@ugcwithaddi10 ай бұрын
Dope explanation Best one on internet 🔥
@md.tamaltahasinkhan644810 ай бұрын
what a detailed explanation!!! ❤
@bhuppidhamii10 ай бұрын
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?
@codestorywithMIK10 ай бұрын
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.
@bhuppidhamii10 ай бұрын
@@codestorywithMIK thank you for your kind words
@akshatmishra95745 ай бұрын
That Was Damn Clean and Good Explanation Bro !!
@ss8273 Жыл бұрын
thank you sir keep it up really helpful........😍😍
@codestorywithMIK Жыл бұрын
Most welcome❤️❤️
@sjxsubham...10 ай бұрын
best.... solution... thank MIK sir
@MakeuPerfect2 жыл бұрын
You are superb
@codestorywithMIK2 жыл бұрын
Thank you so much ❤️❤️❤️
@deveshsharma-u2l8 ай бұрын
thanks bro loved it !Thanks😘😘😘😘😘😍 Enjoyed it Dil de