The idea of taking negative instead of custom comparator🔥🥶
@codestorywithMIK11 ай бұрын
🙏❤️
@AvinashKumar-ps4tw11 ай бұрын
Very well Explained, bahut mehnnat kiye hai aapne to explain us in a structured way. now it duty to practice more Questions based on such patterns.
@codestorywithMIK11 ай бұрын
❤️🙏🙏
@sabbulingineni11 ай бұрын
U r one of the best in the world of c++🤩🤩🤩
@wearevacationuncoverers11 ай бұрын
💯
@thekindspill11 ай бұрын
Hi MIK, i really wish I could do or give something to thank you. Even if you create a Paid course, I would be happy to opt for it. This level of in-depth explanation is not even provided in paid courses. You are a gem and a blessing to all of us.
@DurgaShiva757411 ай бұрын
Improvisation using negative of rating deserve a separate applause 🎉
@anushkathakur653111 ай бұрын
shaana tareeka was awesome😂❤
@Brute_Coder11 ай бұрын
in a mixed feeling tried hard this question ... but when i saw your approach ... i was like how can i think at your veteran level ... ....BTW nice explanation ..AYKI doing great ...
@codestorywithMIK11 ай бұрын
🙏🙏❤️❤️
@molyoxide835811 ай бұрын
The Corner Case was Mind_Blowing
@wearevacationuncoverers11 ай бұрын
How can someone be this good in explanation. It seems that you are the creator of every Qn on leetcode 😅. hats off legend.
@aelishkumar185211 ай бұрын
thank you so much dude for very beautiful explaination as it is little bit complex
@codestorywithMIK11 ай бұрын
Glad it helped! ❤️
@adarshjha512611 ай бұрын
Sir please make videos on problem C and D of today's leetcode contest
As always great video 👌 Btw one question designing data structures and its functionalities is same as LLD which is asked in interview ?
@codestorywithMIK11 ай бұрын
Hi Anup, No there are many differences in LLD and These Problems. LLD involves not only data structure design, but also data base design, API design (as per requirement), OOP concepts related.
@anuppatankar429411 ай бұрын
@@codestorywithMIK ok got that 👍🏻
@RUSTYYYYYYYYY11 ай бұрын
maza aa gya
@manimanohar_00111 ай бұрын
Other Channels: Intelligent Gyan, MIK's channel: Ultra_Intelligent_Gyan
@codestorywithMIK11 ай бұрын
🙏🙏❤️❤️
@32_ec_divagupta2211 ай бұрын
Thank u sir !! Sir can you explain today leetcode contest 3rd and 4th problem in a video
@SadhanaSharma11 ай бұрын
for the 3rd qsn you can take reference from this code : class Solution { public: bool pal(long long num){ long long x= num; long long rev=0; while(x>0){ long long ld= x%10; rev=rev*10+ld; x=x/10; } return rev==num; } long long minimumCost(vector& nums) { long long n= nums.size(); sort(nums.begin(),nums.end()); long long median = nums[n/2]; long long x= median;// to get the left recent palindrome long long y= median;// to get the right recent palindrome while(!pal(x)) x--; while(!pal(y)) y++; long long ans=0,p=0,q=0; for(int i=0;i
Can you tell that according to nowday's scenario should we do cp for oa's ?? Also it will be very helpful if you start a playlist regarding oa's question It's a request 🤗
@codestorywithMIK11 ай бұрын
I have seen a rise in difficulty in OAs these days. CP can definitely boost your preformance but it’s not a mandatory parameter. I have seen people who never did CP but cracked difficult OA problems. So at the end, it all boils down to having a good understanding of dsa and being able to solve under pressure of time contraint. That is why giving leetcode weekly/bi-weekly contests is a very good way to prepare for that. (NOTE - you can also give contests on other platforms as per your choice)
@codestorywithMIK11 ай бұрын
And regarding CP playlist, i am planning to start once all basics DSA Concepts playlist are covered. Probably next year, a lot of things are planned for this channel 🙏❤️😇
@kamranwarsi12b2211 ай бұрын
@@codestorywithMIK ok sir, will be eagrly waiting for that
@codeandtalk611 ай бұрын
❤❤❤
@aadil423611 ай бұрын
kya hum priority-queue me number se nahi aur number aur food ki pair se koi element insert ya remove kar sakte he? kyu ki agar hum changeragint vaale function me koi food ki rating change kar rahe he aur sirf uski rating se vo food remove aur insert karte he to aisa ho sakta he ke ek hi rating vaale 2 food maujud ho pq me aur hum galat waala update karde. mene pq padha he usme sirf number ke bases par hi insert aur remove karte he.
@sanjaykatta649911 ай бұрын
Bro, Can you explain why your choice of datastructure was set instead of priority queue? Though priority queue has faster insertion and removal times compared to TreeSet, Leetcode gives me a better Runtime when I use TreeSet rather than Priority Queue. I didn't understand why. AFAIK, TreeSet is useful in the cases where we need to perform range queries, but here we are not doing any range queries.
@Ramneet0411 ай бұрын
You can just pop the top of priority queue, can't do it for specific food. You have to pop all elements occurs before it and then push back them ( in the case of change food rantings )..
@sanjaykatta649911 ай бұрын
@@Ramneet04 In that case, we can still maitain a mapping between the food and the cuisine as done in this video and delete the old rating (food, old rating object) from the priority queue, Using pq.remove(food, old rating object)
@KESHAVKUMAR-mb2nm11 ай бұрын
Thank U great explanation.
@codestorywithMIK11 ай бұрын
Glad it was helpful! ❤️🙏
@jagadeeshp116311 ай бұрын
how to write the python code for this 😢 i have never solved such problem
@NiveditaJaiswal-s2d11 ай бұрын
why not code in java
@KESHAVKUMAR-mb2nm11 ай бұрын
bro java code is provided in description box.
@NiveditaJaiswal-s2d10 ай бұрын
I know
@varunaggarwal712611 ай бұрын
I was doing it the oops way but getting TLE public class Menu { public string food { get; set; } public string cuisine { get; set; } public int rating { get; set;} } public class FoodRatings { public List m = new List(); public FoodRatings(string[] foods, string[] cuisines, int[] ratings) { for (int i = 0; i < foods.Length; i++) { m.Add(new Menu { food = foods[i], cuisine = cuisines[i], rating = ratings[i] }); } } public void ChangeRating(string food, int newRating) { var menuToUpdate = m.FirstOrDefault(rr => rr.food == food); if (menuToUpdate != null) { menuToUpdate.rating = newRating; } } public string HighestRated(string cuisine) { var highestRatedFoods = m .Where(menu => menu.cuisine == cuisine) .GroupBy(menu => menu.rating) .OrderByDescending(group => group.Key) .FirstOrDefault(); if (highestRatedFoods != null) { var sortedFoods = highestRatedFoods .OrderBy(menu => menu.food) .Select(menu => menu.food) .ToList(); return sortedFoods.FirstOrDefault() ?? ""; } return ""; } }