Design a Food Rating System | Clean Approach | Leetcode-2353

  Рет қаралды 4,046

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 58
@UECAshutoshKumar
@UECAshutoshKumar 4 ай бұрын
Thank you!!!
@ravirajshelar250
@ravirajshelar250 11 ай бұрын
The idea of taking negative instead of custom comparator🔥🥶
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
🙏❤️
@AvinashKumar-ps4tw
@AvinashKumar-ps4tw 11 ай бұрын
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.
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
❤️🙏🙏
@sabbulingineni
@sabbulingineni 11 ай бұрын
U r one of the best in the world of c++🤩🤩🤩
@wearevacationuncoverers
@wearevacationuncoverers 11 ай бұрын
💯
@thekindspill
@thekindspill 11 ай бұрын
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.
@DurgaShiva7574
@DurgaShiva7574 11 ай бұрын
Improvisation using negative of rating deserve a separate applause 🎉
@anushkathakur6531
@anushkathakur6531 11 ай бұрын
shaana tareeka was awesome😂❤
@Brute_Coder
@Brute_Coder 11 ай бұрын
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 ...
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
🙏🙏❤️❤️
@molyoxide8358
@molyoxide8358 11 ай бұрын
The Corner Case was Mind_Blowing
@wearevacationuncoverers
@wearevacationuncoverers 11 ай бұрын
How can someone be this good in explanation. It seems that you are the creator of every Qn on leetcode 😅. hats off legend.
@aelishkumar1852
@aelishkumar1852 11 ай бұрын
thank you so much dude for very beautiful explaination as it is little bit complex
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
Glad it helped! ❤️
@adarshjha5126
@adarshjha5126 11 ай бұрын
Sir please make videos on problem C and D of today's leetcode contest
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
Qn-4 kzbin.info/www/bejne/f5LdXmuQhr6IrNUsi=4qCFdzYompcrUyhy
@souravjoshi2293
@souravjoshi2293 11 ай бұрын
8:53 - That's why you are the best
@aws_handles
@aws_handles 11 ай бұрын
Man, you are gifted with teaching skills.
@ramakrishnakcr4417
@ramakrishnakcr4417 8 ай бұрын
wow
@gauravbanerjee2898
@gauravbanerjee2898 11 ай бұрын
Thanks a lot bhaiya ❤❤
@sauravchandra10
@sauravchandra10 11 ай бұрын
Kaafi acha question tha, and so wasthe explanation.
@DevOpskagyaan
@DevOpskagyaan 11 ай бұрын
Mast 👌🏻
@tutuimam3381
@tutuimam3381 11 ай бұрын
Thanks 👍
@piyushraj5464
@piyushraj5464 11 ай бұрын
Thanks a lot for such a simple and easy explanation. Waiting for the solutions of today's contest.
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
Qn-4 kzbin.info/www/bejne/f5LdXmuQhr6IrNUsi=4qCFdzYompcrUyhy
@vineetkumar2899
@vineetkumar2899 11 ай бұрын
Companies Asked -> Amazon in last 1-2 years
@alokgautam02
@alokgautam02 11 ай бұрын
Thnx for this detailed soln . 😍
@souravjoshi2293
@souravjoshi2293 11 ай бұрын
Asked by amazon
@anuppatankar4294
@anuppatankar4294 11 ай бұрын
As always great video 👌 Btw one question designing data structures and its functionalities is same as LLD which is asked in interview ?
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
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.
@anuppatankar4294
@anuppatankar4294 11 ай бұрын
@@codestorywithMIK ok got that 👍🏻
@RUSTYYYYYYYYY
@RUSTYYYYYYYYY 11 ай бұрын
maza aa gya
@manimanohar_001
@manimanohar_001 11 ай бұрын
Other Channels: Intelligent Gyan, MIK's channel: Ultra_Intelligent_Gyan
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
🙏🙏❤️❤️
@32_ec_divagupta22
@32_ec_divagupta22 11 ай бұрын
Thank u sir !! Sir can you explain today leetcode contest 3rd and 4th problem in a video
@SadhanaSharma
@SadhanaSharma 11 ай бұрын
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
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
Qn-4 kzbin.info/www/bejne/f5LdXmuQhr6IrNUsi=4qCFdzYompcrUyhy
@kamranwarsi12b22
@kamranwarsi12b22 11 ай бұрын
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 🤗
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
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)
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
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 🙏❤️😇
@kamranwarsi12b22
@kamranwarsi12b22 11 ай бұрын
@@codestorywithMIK ok sir, will be eagrly waiting for that
@codeandtalk6
@codeandtalk6 11 ай бұрын
❤❤❤
@aadil4236
@aadil4236 11 ай бұрын
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.
@sanjaykatta6499
@sanjaykatta6499 11 ай бұрын
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.
@Ramneet04
@Ramneet04 11 ай бұрын
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 )..
@sanjaykatta6499
@sanjaykatta6499 11 ай бұрын
@@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-mb2nm
@KESHAVKUMAR-mb2nm 11 ай бұрын
Thank U great explanation.
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
Glad it was helpful! ❤️🙏
@jagadeeshp1163
@jagadeeshp1163 11 ай бұрын
how to write the python code for this 😢 i have never solved such problem
@NiveditaJaiswal-s2d
@NiveditaJaiswal-s2d 11 ай бұрын
why not code in java
@KESHAVKUMAR-mb2nm
@KESHAVKUMAR-mb2nm 11 ай бұрын
bro java code is provided in description box.
@NiveditaJaiswal-s2d
@NiveditaJaiswal-s2d 10 ай бұрын
I know
@varunaggarwal7126
@varunaggarwal7126 11 ай бұрын
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 ""; } }
Most Frequent IDs | Complete Intuition | Leetcode 3092 | codestorywithMIK
31:59
Can You Find Hulk's True Love? Real vs Fake Girlfriend Challenge | Roblox 3D
00:24
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 60 МЛН
Симбу закрыли дома?! 🔒 #симба #симбочка #арти
00:41
Симбочка Пимпочка
Рет қаралды 5 МЛН
Why is Python 150X slower than C?
10:45
Mehul - Codedamn
Рет қаралды 17 М.
Design a Food Rating System - Leetcode 2353 - Python
15:37
NeetCodeIO
Рет қаралды 14 М.
How My Friend Coded Consistently for 500 Days on LeetCode? 🔥
16:13
How I Mastered Data Structures and Algorithms in 8 Weeks
15:46
Aman Manazir
Рет қаралды 102 М.
NVIDIA’s New AI: Stunning Voice Generator!
6:21
Two Minute Papers
Рет қаралды 73 М.