Design Underground System | Full Thought Process | Bloomberg | Amazon | Leetcode 1396

  Рет қаралды 1,637

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 34
@riyakansal3312
@riyakansal3312 Жыл бұрын
One of the finest explanations... and finally I earned the MAY batch, thanks to you sir💖💖
@codestorywithMIK
@codestorywithMIK Жыл бұрын
So happy to hear that. Feel free to share that everywhere to spread the motivation Thanks again
@mohithadiyal6083
@mohithadiyal6083 Жыл бұрын
simply amazing
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Mohit ❤️
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
Never fail to mesmerise me. You have a unique way of teaching bro. People will talk about you in future.
@tutuimam3381
@tutuimam3381 Жыл бұрын
Amazing explanation
@AlishaKhan-ww3io
@AlishaKhan-ww3io Жыл бұрын
Finest tutor on KZbin
@UECAshutoshKumar
@UECAshutoshKumar 4 ай бұрын
Thank You!
@sidharthdhiman4522
@sidharthdhiman4522 Жыл бұрын
best method to solve the queison is through story sir , amazing , i did figureed out of checkin map and type also but wans't able to get the checkout mp and what would be the key and value but when you approach the problem through reverse method finding first checkoutmap and through that you ind what should be the checkin is amazing approach
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you Sidharth ❤️❤️
@floatingpoint7629
@floatingpoint7629 Жыл бұрын
thanks for this. it was helpful i was able to it myself after seeing the story points
@anuppatankar4294
@anuppatankar4294 Жыл бұрын
Great video 👍🏻
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Anup ❤️❤️
@wearevacationuncoverers
@wearevacationuncoverers Жыл бұрын
This is the one stop solution to all my problems. ❣
@mewaconite
@mewaconite Жыл бұрын
thank you for creating this video, always love your explanation ❤
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot ❤️❤️
@shikharpandya4927
@shikharpandya4927 4 ай бұрын
thank u sir
@codeandtalk6
@codeandtalk6 Жыл бұрын
@codestorywithMIK
@codestorywithMIK Жыл бұрын
❤️❤️
@boomburstshorts2347
@boomburstshorts2347 Жыл бұрын
Finally the video came 😁
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Sorry for delay today . Little hectic day. Thank you for trusting my channel ❤️
@tauquirahmed1879
@tauquirahmed1879 Жыл бұрын
Yeah mera pehla view ❣️
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot ❤️❤️
@thephalcon
@thephalcon Жыл бұрын
Sir javascript se bhi implement kriye please
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Hello there, Unfortunately I am not well versed with Javascript Data structs but I can help provide the code from other source. Please find it below . I hope that helps : var UndergroundSystem = function () { this.checkInData = new Map(); this.journeyData = new Map(); }; /** * @param {number} ID * @param {string} checkInStation * @param {number} checkInTime * @return {void} */ UndergroundSystem.prototype.checkIn = function (ID, checkInStation, checkInTime) { this.checkInData.set(ID, new CheckIn(checkInStation, checkInTime)); }; /** * @param {number} ID * @param {string} checkOutStation * @param {number} checkOutTime * @return {void} */ UndergroundSystem.prototype.checkOut = function (ID, checkOutStation, checkOutTime) { let checkIn = this.checkInData.get(ID); this.checkInData.delete(ID); let journey = checkIn.checkInStation + "->" + checkOutStation; if (!this.journeyData.has(journey)) { this.journeyData.set(journey, [0, 0]); } this.journeyData.get(journey)[0] += checkOutTime - checkIn.checkInTime; this.journeyData.get(journey)[1]++; }; /** * @param {string} startStation * @param {string} endStation * @return {number} */ UndergroundSystem.prototype.getAverageTime = function (startStation, endStation) { let journey = startStation + "->" + endStation; return this.journeyData.get(journey)[0] / this.journeyData.get(journey)[1]; }; function CheckIn(checkInStation, checkInTime) { this.checkInStation = checkInStation; this.checkInTime = checkInTime; }
@honey6567
@honey6567 Жыл бұрын
bhaiya please code force bhi start kr do
@codestorywithMIK
@codestorywithMIK Жыл бұрын
I will plan that soon. Just planning to first complete important playlist of Graph, DP etc Then i will start uploading GFG POTD, Contests, codeforces etc
@kuchtha9982
@kuchtha9982 Жыл бұрын
Mera second comment😊
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot ❤️❤️
@honey6567
@honey6567 Жыл бұрын
their are more child come on youtube to teach algo those Algo that are already cover in most youtuber
@honey6567
@honey6567 Жыл бұрын
every think and every code teaches fail on front of you like , labb labb labb;.. every youtuber are smill knowladege on data structer
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Means a lot Honey ❤️❤️❤️
@honey6567
@honey6567 Жыл бұрын
@@codestorywithMIK bhaiya please please codeforce bhi start kr do na ..
@yuvhrajverma9665
@yuvhrajverma9665 Жыл бұрын
Sir can u plz tell me what's wrong with this code , only passes 48 testcases class UndergroundSystem { class pair{ int id,t; pair(int id,int t){ this.id=id; this.t=t; } } HashMapcheckin; HashMapcheckout; public UndergroundSystem() { checkin=new HashMap(); checkout=new HashMap(); } public void checkIn(int id, String stationName, int t) { ArrayListl=checkin.getOrDefault(stationName,new ArrayList()); l.add(new pair(id,t)); checkin.put(stationName,l); } public void checkOut(int id, String stationName, int t) { ArrayListl=checkout.getOrDefault(stationName,new ArrayList()); l.add(new pair(id,t)); checkout.put(stationName,l); } public double getAverageTime(String startStation, String endStation) { ArrayListl=checkin.get(startStation); ArrayListl1=checkout.get(endStation); int c=0; double s=0; for(pair p:l){ for(pair p1:l1){ if(p.id==p1.id){ s+=(p1.t-p.t); c++; } } } s/=c; return s; } }
Snapshot Array | Full Thought Process | Microsoft | Amazon | Leetcode 1146
35:05
Design a Food Rating System | Clean Approach | Leetcode-2353
25:33
codestorywithMIK
Рет қаралды 4 М.
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 36 МЛН
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 3 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН
Design Underground System  - Leetcode 1396 - Python
8:56
NeetCodeIO
Рет қаралды 8 М.
System Design Interview - Top K Problem (Heavy Hitters)
36:18
System Design Interview
Рет қаралды 376 М.
LFU Cache - (Microsoft)  :  Explanation➕Live Coding
49:29
codestorywithMIK
Рет қаралды 9 М.
Naming a Company - Leetcode 2306 - Python
16:38
NeetCodeIO
Рет қаралды 10 М.
NVIDIA’s New AI: Stunning Voice Generator!
6:21
Two Minute Papers
Рет қаралды 76 М.
Champagne Tower | Recursion | Memoization | GOOGLE | Leetcode - 799
29:28
codestorywithMIK
Рет қаралды 4,2 М.
20 System Design Concepts Explained in 10 Minutes
11:41
NeetCode
Рет қаралды 1,1 МЛН