Find Median from Data Stream | Google | Amazon | Microsoft | Meta | Explanation | Live Coding

  Рет қаралды 8,252

codestorywithMIK

codestorywithMIK

Жыл бұрын

This is the 1st Video on our Heap playlist.
In this video we will try to solve a very famous and interesting Problem "Find Median from Data Stream".
Share your learnings on LinkedIn, Twitter (X), Instagram, Facebook(Meta) with hashtag
hashtag#codestorywithmik & feel free to tag me.
We will do live coding after explanation and see if we are able to pass all the test cases.
Problem Name : Find Median from Data Stream
Company Tags : Apple, AMAZON, VMWARE, GOOGLE, MICROSOFT, GOLDMAN SACHS, Adobe, Belzabar, SAP Labs, Yahoo, D-E-Shaw, Facebook, Flipkart, Google, Intuit, Microsoft, Morgan Stanley, Ola Cabs, Oracle, Samsung
My solutions on Github : github.com/MAZHARMIK/Intervie...
Leetcode Link : leetcode.com/problems/find-me...
My GitHub Repo for interview preparation : github.com/MAZHARMIK/Intervie...
Subscribe to my channel : / @codestorywithmik
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview #interviewtips
#interviewpreparation #interview_ds_algo #hinglish

Пікірлер: 79
@level_up.1908
@level_up.1908 10 ай бұрын
Log video sirf isliye nahi dekh paate hn kyuki unhe lagta hn views kam hn ,par jise pata hn use toh pata hi hn
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
It means a lot ❤️❤️😇😇🙏
@level_up.1908
@level_up.1908 10 ай бұрын
@@codestorywithMIKbro, I hope we will meet one day and discuss the hard work together .
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Sure ❤️😇
@souravjoshi2293
@souravjoshi2293 3 ай бұрын
sahi baat.
@bandariAkshay-js1lv
@bandariAkshay-js1lv 3 күн бұрын
Great explanation! The use of max-heap and min-heap to efficiently find the median is both neat and clean. Thanks for breaking down the logic so clearly.
@loirobin
@loirobin 15 күн бұрын
this was the best solution explanation of this approach, people are not even considering this approach. Thanks for the solution.
@sayyidzyanashraf
@sayyidzyanashraf 5 күн бұрын
Thank you so much Sir... Very nice explanation of the algorithm and intuition behind it.
@mirdulswarup9065
@mirdulswarup9065 Жыл бұрын
Coming to this channel and solving leetcode daily challenge is a ritual. I just wish the man behind dosnt stop making these
@codestorywithMIK
@codestorywithMIK Жыл бұрын
I won’t ❤️
@OG_AnjaliPannu_
@OG_AnjaliPannu_ 17 күн бұрын
amazing explanation
@engineeringsolved
@engineeringsolved 12 күн бұрын
i love your videos sir and love your explanation. Thank you so muchhhh
@Hello-ep2fi
@Hello-ep2fi 11 ай бұрын
Bro, I am just mesmerized by your way of explanation! I don't comment on youtube frequently ,but your content forced me to do that. Watched some other videos of yours too. I am highly grateful for your content. Please just don't be demotivated by the number of subscribers or the number of views you are getting. Just keep up the good work bro!! Thanks again!!
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
This comment made my day. Thank you so much ❤️❤️❤️
@sarfraznawaz6379
@sarfraznawaz6379 Жыл бұрын
your channel will reach 100k within the next one year coz of your top notch explanations! Likke lelena bhai 👌Your like the hindi and c++ version of "neetcode"!! 😍
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Wow. This made my day. Thanks a lot ♥️♥️♥️
@sanjaykatta6499
@sanjaykatta6499 6 ай бұрын
He's better than neetcode
@DushyantSingh-jn7pm
@DushyantSingh-jn7pm 22 күн бұрын
best teacher so far
@iamnoob7593
@iamnoob7593 2 күн бұрын
Thanks man , Ur explanation is brilliant
@Ybash2979
@Ybash2979 13 күн бұрын
great explanation :)
@codestorywithMIK
@codestorywithMIK 13 күн бұрын
Glad you liked it! ❤️
@vilakshan.s
@vilakshan.s 21 күн бұрын
Very nice explanation, agreed with the other comments in the thread
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
I was literally waiting for your explanation to this Hard Qn. I always look up to your solution. And no doubt one of the best explanation. I think the solution is Medium Level. But figuring out how to use Heap is Hard. You made it easy bro. Thank you like always. Pleas keep posting videos on Hard Qns like this. 10:01 (Priority Queue)
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot ❤️❤️❤️
@nikilsaini4009
@nikilsaini4009 Ай бұрын
Following you since 12k bro, Happy to see your growing !!
@codestorywithMIK
@codestorywithMIK Ай бұрын
❤️❤️🙏🙏
@bushranazish5863
@bushranazish5863 Жыл бұрын
Your code is always in so neat format !!! Your channel is GOLD and you are a GEM Sir 💎💎
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much 😊
@abhishekverma7604
@abhishekverma7604 10 ай бұрын
the concept of median is frequently tested by interviewers either if it's in binary search or heap.. your explanation skills are top notch bhya....
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Means a lot. Thank you 😇❤️
@dayashankarlakhotia4943
@dayashankarlakhotia4943 11 ай бұрын
Mind blowing explanation going peak of mountains
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
Thank you so much 😇🙏❤️
@amitkumarchoudhary9008
@amitkumarchoudhary9008 10 ай бұрын
bhaiya thanku so much 😭😭maine sabke video dekh li but smjh apki aayi sirf plzz aise video bnate rho
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Thank you 😇❤️
@abhinaysahumusic6062
@abhinaysahumusic6062 Ай бұрын
bro i would suggest a better channel name, which sounds more professional-like and a better icon/picture for the avatar, maybe your own face. your explanations are top notch but the first impression i had of this channel was not good, just a suggestion man i really appreciate your good work !
@iakshow
@iakshow Ай бұрын
Agreed, under rated teacher.
@divyanshsagar
@divyanshsagar Жыл бұрын
Beautifully explained!
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much ❤️
@AbhinavAnand-rp4uz
@AbhinavAnand-rp4uz 9 күн бұрын
why did you use abs() ? i mean difference negative tab hi aayega na jab right_min_ haep ka size jyada ho , jabki if statement ke andar ye likha hai ki left_max_heap ka size bada ho gya isiliye , left max ka top right me daal diya gya. please ans my doubt..
@niharikagoulikar2921
@niharikagoulikar2921 10 ай бұрын
Aap awesome ho! Itni kamal ki explanation di hai apne
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Thank you 🙏 😇
@gautamarora6556
@gautamarora6556 Жыл бұрын
Excellent explanation!
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much ❤️❤️❤️
@anushkathakur6531
@anushkathakur6531 8 ай бұрын
bhaiya,last mein aapne abs() kyon kiya??agar 1 aur 2 size vala case hua jo aapne 34.40 time stamp par liya hai....tab toh automatically else if vala case hit ho jayega...
@theeduhub178
@theeduhub178 4 ай бұрын
wahi toh else if usse handle kar hi lega phir absolute kyun lena pada
@ramandeepsingh8464
@ramandeepsingh8464 5 ай бұрын
bhiya Op explanation no body can beat maza aagya
@codestorywithMIK
@codestorywithMIK 5 ай бұрын
❤️❤️🙏🙏
@zainabnoor3222
@zainabnoor3222 Жыл бұрын
Best explanation ✨
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot 😇
@--Blood--Prince--
@--Blood--Prince-- 8 ай бұрын
Wonderful explanation 🤗🤗
@codestorywithMIK
@codestorywithMIK 8 ай бұрын
Glad you liked it 😇🙏
@k-CE-OmkarPathak
@k-CE-OmkarPathak 6 ай бұрын
made hard qs easy!! Thanks a lot
@Chakss
@Chakss 10 ай бұрын
Amazing++
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Thank you 😇🙏
@sanjaykatta6499
@sanjaykatta6499 6 ай бұрын
Bro as extension to this video, can you please explain the follow up questions as well?
@mohitkumarprajapati1914
@mohitkumarprajapati1914 2 ай бұрын
In this "If" condition (abs((int)left_max.size()-(int)right_min.size())>1) 🤔why there is need to 'type-cast' the return value of .size() as it also return "unsigned integral Value" in case of Priority Queue
@de_coder1
@de_coder1 7 ай бұрын
People say movies are underrated, I say I have underrated KZbin channels
@codestorywithMIK
@codestorywithMIK 7 ай бұрын
Means a lot 😇🙏❤️
@gauravbanerjee2898
@gauravbanerjee2898 3 ай бұрын
Was struggling on this question even after watching several tutorials from other creators 🥹 Jaise hi apka video dikha dil garden garden ho gya 😂❤
@codestorywithMIK
@codestorywithMIK 3 ай бұрын
I hope my video helped Thank you for watching 😇😇🙏🙏❤️❤️
@rounaq_khandelwal
@rounaq_khandelwal 11 ай бұрын
☺☺ hard--->easy
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
😇❤️
@omeditsx
@omeditsx Жыл бұрын
Bro at 35:03 in else if section you have already covered that case then why we have to use absolute in if
@ashishdhal4614
@ashishdhal4614 Жыл бұрын
Bhai clear hua to bata do
@divyanshsagar
@divyanshsagar Жыл бұрын
There is no need to use abs. The code will work fine even if there is no abs. But we have to use (int).
@jaanviarora6644
@jaanviarora6644 11 ай бұрын
@@divyanshsagar why do we have to use int ?
@phoddaal7130
@phoddaal7130 10 ай бұрын
​@@divyanshsagar why do we need to use int isn't it like the dot size function is return integer value only
@gauravbanerjee2898
@gauravbanerjee2898 3 ай бұрын
Bhaiya at 34:50 you said if we have 1 element in left queue and 4 in right queue so that's why we are taking the abs value. But according to the logic you said if the left maxheap has greater element then only we will push elements from left queue to right queue. And if the size of the left queue is smaller than the right one then it is handled in the next else if condition. So why are we taking abs value in the first if condition if we know that this will be executed only when the left queue has more elements than the right queue. I am a little bit confused here can you please clarify this 🙂🙂
@codestorywithMIK
@codestorywithMIK 3 ай бұрын
Ah yess. You can ignore abs. Even if you don’t apply abs, it will work as expected ❤️❤️🙏🙏
@gauravbanerjee2898
@gauravbanerjee2898 3 ай бұрын
@@codestorywithMIK Got it bhaiya .Thanks for clarifying 😇
@abinashdash7864
@abinashdash7864 3 ай бұрын
@@codestorywithMIK bhaiya,it's not working without abs
@rev_krakken70
@rev_krakken70 Ай бұрын
Hi.. wanted to ask if it is possible to solve this problem using avl tree
@FinanceMode14
@FinanceMode14 9 ай бұрын
why more element in max heap as compared to min heap ?
@anubhavsingh9848
@anubhavsingh9848 8 ай бұрын
No specific reason, you can choose to take the extra element in the min heap as well. Then in case of odd elements, you would return the top element from the min heap
@gyanaranjan6526
@gyanaranjan6526 Жыл бұрын
Bro plz code in python or javascript I dont know c++ plz
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Hi Gyan, sure i will try to provide the code for python as well from next time. I am not proficient in them but i will try to provide them too. Thanks again for watching ❤️❤️❤️
@udaytewary3809
@udaytewary3809 Жыл бұрын
Take a bow bhaiya you really deserved it The way you u explain is really really amazing every part of the code is perfectly crystal clear to me and you explain in such a way that every why and how part of each code is clear to me and will never forget ❤️ 😊 One thing bhaiya please don't get demotivated by less no of subscriber this is your initial phase you will grow sooner as quality things take time to grow Bhaiya are you on Linkedin can you please provide your id
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Hi Uday, Thank you so much for your precious words. It made my day Thanks a lot ❤️❤️❤️❤️ Yes you can connect with me on LinkedIn, i have mentioned it in my KZbin channel (profile) click on LinkedIn icon
Sort Characters By Frequency | Heap | Leetcode 451
16:53
codestorywithMIK
Рет қаралды 3,2 М.
MEU IRMÃO FICOU FAMOSO
00:52
Matheus Kriwat
Рет қаралды 37 МЛН
MEGA BOXES ARE BACK!!!
08:53
Brawl Stars
Рет қаралды 34 МЛН
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 65 МЛН
Leetcode 295. Find Median from Data Stream Intuition + Code C++ Example
27:59
Segment Tree | Update Query | Story To Code | Video 2
22:23
codestorywithMIK
Рет қаралды 1,7 М.
LRU Cache | Brute Force | Optimal | Detailed | Leetcode 146
40:32
codestorywithMIK
Рет қаралды 10 М.
CANDY | 2 Approaches | O(1) Space | O(N) Space | AMAZON | Leetcode - 135
39:33
MEU IRMÃO FICOU FAMOSO
00:52
Matheus Kriwat
Рет қаралды 37 МЛН