Others posting 10-15 minutes video on this problem. Here is the LEGEND MIK with 50 minutes video with Brute Force, Better and optimal 🔥🔥🔥🔥
@dchennaraiduАй бұрын
LOL! He's the best
@harchitgulati3065Ай бұрын
bro time of video se matter ni karta MIK is Legend agreed but jha se jisko smjh aa rha best for them
@EB-ot8uuАй бұрын
Feeling bad for those who will skip this video because of length. This is nothing but pure gold. This legend actually teaches how our thought process should work during solving such problems. Thanks a lot
@froglighthouse1223Ай бұрын
instead of watching 15 min videos 5 times and still not understanding clearly, it is better to watch this 50 minute video and get all concepts fixated into your mind forever
@codestorywithMIKАй бұрын
♥️♥️🙏🙏
@shreyanshgupta6465Ай бұрын
This is the naive approach that I wrote and it passed 89/90 test cases with the time complexity of O(n^3). Thanks, bro your explanation really gives a natural feeling (like koi bhaiya apne bhai ko sikha rhe ho)
@harshchhallani2268Ай бұрын
I never comment, but you deserve one for taking me from the most native to the optimal , and you made me think of the solution unlike others just telling this is the way to do it. You develop our brains to think like you think when you tackle a problem.
@tharunkumar8133Ай бұрын
Those who are not watching the video because of the duration are missing out on so much good stuff.. Keep it up Mr. MIK!!
@EB-ot8uuАй бұрын
true bhai
@kushjoshi9427Ай бұрын
i have done a similar question on leetcode called merge k sorted linked list the concept is same for the using the heap. That time I didn't grasp the concept fully thanks to you now i know it better.
@amanpaliwalvlogs6860Ай бұрын
Bhai..... salute you ❤❤❤
@jeehub041Ай бұрын
Proper Proper explanation bhaiya pura brute se optimal tak sab chamak gaya🙌🙌
@diskritis2076Ай бұрын
its funny that i was not able to solve the problem originally but when i listened to his brute force solution, i just solved the problem on my own lol.
@chic_kooАй бұрын
Wow 😲, the way you started with simplest thought process ❤ and go step by step maza hi aa gya yrr bhaiya , amazing. Your dedication and hard work toward teaching us how to approach solution , rally you make us think the solution itslef. Greatttttt yrr
@nehasinghggpl9637Ай бұрын
you are awesome aapke bade video bhi darate nhi hai, aaram se dekh leti hu..
@souravjoshi2293Ай бұрын
Few of the words I call MIK with now : 1. Legend 2. Goat 3. DSAGOD If you doubt it, watch his videos and thank me later
@mohammadaftabansari6882Ай бұрын
Thanks for the awesome detailed explanation, Yoyr videos are a great help in my DSA journey.
@basu8870Ай бұрын
God level explanation 🔥🔥🔥🔥🔥
@SunshineWisdom-h2pАй бұрын
Thank you, Bhaiya for explaining everything in detail .
@skmdjeesan_Ай бұрын
you are legend sir!
@codingedtechАй бұрын
super....... explained 😮
@bokthair4605Ай бұрын
00:03 Introduction to Leetcode problem 632 with multiple ways 00:54 Smallest Range Covering Elements from K Lists 02:34 Understanding the concept of smallest range covering elements in K lists. 03:18 Finding the smallest range covering elements from K lists 04:57 Creating ranges in a list based on given conditions 05:42 Finding the smallest range covering elements from K lists 07:17 Finding the smallest range covering elements from multiple lists 08:05 Finding the range between numbers in the list. 09:33 Finding valid pairs and tracking minimum range 10:17 Understanding the importance of sorted input in algorithms. 11:44 Find the smallest range covering given numbers 12:33 Selecting smallest range covering elements from K lists 14:07 Understanding and accessing elements using pointers in lists 14:54 Finding the minimum and maximum elements to create a range. 16:21 Understanding how to minimize range in a list of elements. 17:06 Avoid altering the maximum element in the range while minimizing the range size. 18:31 Updating minimum and maximum elements in a list 19:17 Finding the smallest range 20:47 Finding the smallest range covering elements from K lists 21:24 Efficiently find the smallest range covering elements from K lists. 22:54 Calculating the smallest range from elements in K lists 23:39 Finding the smallest range from K lists 25:06 Break the loop, find smallest range from K lists 25:49 Solving minimum and maximum range covering elements with constraints 27:25 Remember indexes of each list at starting 28:07 Finding the minimum element and its index in a list 29:43 Identifying the minimum element's index is crucial 30:24 Continuously update and maintain the range for out of bound list 31:49 Explaining smallest range covering elements from K lists 32:42 Find the minimum and maximum value from each list 34:35 Understanding range calculation in a list of elements 35:40 Updating the range if minimum element is changed 37:39 Implement a solution to find the smallest range covering elements from K lists. 38:59 Understanding the optimal approach for heap in detail. 40:33 Understanding element identification and tracking in lists 41:37 Min heap can be used to find the smallest range covering elements from K lists 43:06 Checking for minimum element indices 43:55 Understanding index and priority in pushing elements 45:30 Understanding the importance of values and indices 46:15 Using min heap and storing elements and their indices. 47:48 Understanding the process of finding the smallest range covering elements from K lists. 48:42 Explanation of finding the maximum of elements 50:33 Explaining how to handle minimum range 51:30 Algorithm to find the smallest range covering elements from K lists
@dayashankarlakhotia4943Ай бұрын
leetcode weekly contest qn.no.4 is so good I have solve qn no.3 dp for inspiring your dp playlist🎉❤
@anuragprajapati3712Ай бұрын
nice explanation , very much informative!!
@akashnaik5567Ай бұрын
Legend Mike bhai ❤
@quantum_engineeringАй бұрын
crazy explanation ❤❤
@thaman701Ай бұрын
Wow sir what an explanation 🎉❤
@mdfarhan5364Ай бұрын
Can you also provide explanation of good contest problems like tomorrow last 2 questions
@AryanVats603Ай бұрын
Was waiting for it!!!
@YashSinghalАй бұрын
Amazing. But very very hard to think of this approach during an interview.
@Coder_Buzz07Ай бұрын
Motivation❤❤❤❤
@jeehub041Ай бұрын
Ist view as always but bhaiya please Leetcode Contest ke questions pe bhi ek video per day laaiye because koi acha explanation available hi nahi ha. Please bhaiya only 2 videos every day Will make a huge difference in our lifes ❤❤
@wearevacationuncoverersАй бұрын
Jitna thanks bolu kam hai. Sir aapse milna hai and thank you bolna hai saamne se.
@YashJain-ex2exАй бұрын
I was thinking using with the binary search as there is a mention of range, and binary search deals with range also, for the given test case if we consider to get the smallest and the largest it would be [0, 30], now our and lies between 0 and 30, binary search to find mid = 0+30 = 15 find the = in another (or directly store the range )element from each list and select the range which is shortes, and then perform again, if the answer does not change that is the answer will it work?
@abhinay.kАй бұрын
thanks
@vivekyadav-tharoaraАй бұрын
I tried by myself ( 5hr😢 ) i am able to pass 89/90 and last one gave me Time limit exceed.
@vickyroy3595Ай бұрын
MIK , do video on weekly contest
@gui-codesАй бұрын
third ❤ Wait is Over.
@aizad786iqbalАй бұрын
a < c if b - a == d - c. why this case u didn't cover in method 1 , will it never occur ?
@ShresthBhattacharjee-xz7ihАй бұрын
I tried it using binary search passed 67/90 testcases was waiting for video for the solution. Thank you for your hard work for us❤.
@ArnabBhadra02Ай бұрын
While(!pq.enpty( ) ke badle while (true ) bhi to de sakte the na? Kiuki break to hogahi hoga
@Siddharthsirsate77Ай бұрын
Which writing notes application do you use?
@nikhilvasu478Ай бұрын
idk why, i got TLE with first method, optimized bruteforce
@monugit9Ай бұрын
⭐
@ManojKrVerma-vw4dxАй бұрын
I could solve this on my own. So it feels like it should not have been a hard tagged problem. BTW I enjoyed solving it. @MIK bhaiya what are your thoughts on it ?
@codestorywithMIKАй бұрын
That’s great that you solved on your own. It was a very good Qn
@khushvantkumar1670Ай бұрын
Contest ka video bnao bhai
@rajeshkumar-ws5kuАй бұрын
bhaiya what i do ,i can't able to solve leetcode contest questions despite giving our 100 percent ,i have solve around 300 questions on leetcode ,despite that i am not able to solve the question.Please give me some suggestions bhiya it helps me alot.
@Engineeringlife651Ай бұрын
Us bro us
@RajeshKumar-xe7mkАй бұрын
What do u mean @@Engineeringlife651
@shreyanshjain1595Ай бұрын
WHAT IF THERE ARE TWO MINIMUM NUMBERS,THEN WHICH POINTER WILL WE HAVE TO MOVE , HOW DO WE DECIDE THAT?
@gauravbharti7852Ай бұрын
What's the key for code indentation?
@shreyanshjain1595Ай бұрын
HOW DID YOU GET THE INTUITION OF THIS SOLUTION 😭 PLEASE EXPLAIN
@WealthVibe1Ай бұрын
i tried brute force i got tle
@dayashankarlakhotia4943Ай бұрын
First 🎉❤
@anukulsahuАй бұрын
Bhai interview me koi kaise sochega ye approach
@RishabhChatterjee-fg2gzАй бұрын
Array and strings k problem mein dikkat Hota Hai, kyese improve karu, bolo bhaiya, aap reply nehi karte ho
@rode_atharvaАй бұрын
i found solution by myself in 5 minutes. just cant figure out how to handle max element.
@md.taohidimamkhantamim9747Ай бұрын
52 minutes were as like as story.
@thekindspillАй бұрын
🫡🔥
@tvshows4721Ай бұрын
Sir Why your contest rating is too low ?
@codestorywithMIKАй бұрын
I used to give contests long before. Now i travel during weekends ♥️ But when I get time, I do solve Qn4 sometimes and post on my channel
@tvshows4721Ай бұрын
@@codestorywithMIK ok Sir
@gauravmundhada1647Ай бұрын
How come one will able to think this solution in interview😭
@RishabhChatterjee-fg2gzАй бұрын
Bhaiya I am demotivated because problem is not solved by me, even brute force also, after watching I can solve it
@priyanshugupta5893Ай бұрын
bhai karte jaao bass, interview main sirf ek baar lucky hone hai. toh agar 10 doge ek lagega. and you only need one job :)
@mahalakshmi.m7994Ай бұрын
Mik can u please upload potd in english from tomorrow..🙏
@ch0c0_1Ай бұрын
I think we get more clarity in hindi than English, so i disagree
@aws_handlesАй бұрын
Hindi is very helpful 😢 i understand it easily. Please keep in Hindi
@harishms5330Ай бұрын
Bro on captions
@simrannegi7608Ай бұрын
if i could give you thousands of likes, I definitely would!
@dhairyachauhan6622Ай бұрын
VERY SIMPLE SOLUTION USING PRIORITY_QUEUE MINING METHOD. class Node { public: int data; int i; int j; Node(int data, int i, int j) { this->data = data; this->i = i; this->j = j; } }; struct comparator { bool operator()(Node* a, Node* b) { return a->data > b->data; } }; class Solution { public: vector smallestRange(vector& nums) { int n = nums.size(); priority_queue pq; int maxVal = INT_MIN; for (int i = 0; i < n; i++) { pq.push(new Node(nums[i][0], i, 0)); maxVal = max(maxVal, nums[i][0]); } coutj; pq.pop(); int rangeVal = maxVal - data; if (rangeVal < minRange) { minRange = rangeVal; ans[0] = data; ans[1] = maxVal; } if (j + 1 < nums[i].size()) { pq.push(new Node(nums[i][j + 1], i, j + 1)); maxVal = max(maxVal, nums[i][j + 1]); } else { break; } } return ans; } };