Best channel to learn how to solve questions in competitive coding systematically.
@vinceluu3 жыл бұрын
Found your channel during my leetcode prep for interviews, super concise and clear explanations! Please keep uploading solutions!
@ShiranAfergan3 жыл бұрын
Thanks Vince! I’m working on a new one. Hopefully will be up in a week or so.
@sahiljain25242 жыл бұрын
Crazy Insaan!! you are great. The way you solve and boil down to a simple formula and make the question so so easy is so insan now i am fan of your hats off to you skills
@awfulprogrammer6192 жыл бұрын
I hope you are doing well. This is so great explanation! Keep Uploading and keep Shining!
@ashishkumarshrivastava22573 жыл бұрын
Amazing explanation. The diagram you used to explain made it really simple to understand.
@ShiranAfergan3 жыл бұрын
Thanks! I’m glad it helped :)
@Vishal_ingole2 жыл бұрын
The way of explanation with visual effects is too good, Thanks for the video 😊
@deathstrokebrucewayne3 жыл бұрын
Your Explanations are just so great - To the point - No beating around the bush and extremely helpful. But you stopped making videos :( More power to you and may we find more such videos Admiration from India
@ShiranAfergan3 жыл бұрын
Thanks Aadarsh! I didn’t stop, I’ve been extra busy lately but will post more soon :)
@manokumar893 жыл бұрын
Thanks for an amazing explanation. 1. when you showed how the first example will work in a grid by removing the stones from 1.12 onwards, you are removing in the same order as if you remove the leaves from its spanning tree. how to actually go there? if we remove randomly matching stones, it wont end up with just 1 stone. 2. why the worst case complexity of naive solution is O(n2logn) if the amortized complexity of union-find is a constant: shouldn't the complexity be O(n2)? 3. what is the complexity of the final solution?
@jaideeppyne18803 жыл бұрын
@Shiran Afergan There is so much clarity in your explanation! Superb.
@ShiranAfergan3 жыл бұрын
Thanks Jaideep! I’m glad you enjoyed it :)
@jaideeppyne18803 жыл бұрын
Cheers from India. Looking forward to more such awesome content.
@choicespecss Жыл бұрын
Thank you for your videos and content stumbled across this video looking for union find solution to this problem. I hope you continue to upload videos and content!
@AnshulSharma-gq2vn Жыл бұрын
Very well explained Shiran!! Kudos!
@satviksharma48973 жыл бұрын
Oh lord how I have struggled with this problem, where have you been
@ShiranAfergan3 жыл бұрын
Haha glad it helped :)
@venkateshng20102 жыл бұрын
I really enjoyed your explanation and the clean code you write, I am prepping for google interview next week, your channel came to me at the right time via leetcode discuss forum :) please keep making more videos
@ShiranAfergan2 жыл бұрын
Working on it :) best of luck with your interview! 💪🏽
@beksultanomirzak98032 жыл бұрын
Astonish! thanks for your hard work
@shaydratler47773 жыл бұрын
You are very Fluent and like the visualization Thanks for the hard work
@ShiranAfergan3 жыл бұрын
Thanks 😊 glad you enjoyed it!
@senthilpalanisamy1513 жыл бұрын
These videos deserve more views!
@ShiranAfergan3 жыл бұрын
Thanks Senthil :)
@domod4813 жыл бұрын
Great explanation !! I really liked the way you explain the problem from scratch : ) Subscribed...
@ShiranAfergan3 жыл бұрын
Thank you 🙏🏽:)
@nipunshah13732 жыл бұрын
Splendid Explanation !
@Victoria-dk2jm2 жыл бұрын
Perfect explanantion !!
@ShiranAfergan2 жыл бұрын
Thanks :)
@akashkirthik98823 жыл бұрын
Amazing explanation ! Please keep making videos !
@ShiranAfergan3 жыл бұрын
Thank you 😊 I’m working on it :)
@karanjkarnikhil42 жыл бұрын
What an amazing explanation !!!!
@ShiranAfergan2 жыл бұрын
🙏🏽🙂
@codingwithanonymous8902 жыл бұрын
Explained so well.
@eg7eg73 жыл бұрын
Loved your explanation! thanks
@akshaygoyal21343 жыл бұрын
Elegant solution. You have got a new subscriber :)
@ShiranAfergan3 жыл бұрын
Thanks Akshay! I’m glad you liked it :)
@oknd65643 жыл бұрын
Explanation is really awesome.
@ShiranAfergan3 жыл бұрын
Thank you 🙏🏽 😊
@ujjwalchopra28803 жыл бұрын
awesome explanation thank you.. keep making videos
@ShiranAfergan3 жыл бұрын
Thanks:)
@chris.w3913 жыл бұрын
Thank you! Well explained.
@parthghosh13435 ай бұрын
thank you, great explanation
@aditya2345673 жыл бұрын
OMG ur very good at explaining
@ShiranAfergan3 жыл бұрын
Thank you! I’m glad you liked it :)
@mlishka3 жыл бұрын
Hey .. awesome explanation. Subscribed for easy explanation. Keep up the good work. Can you please do a videos on problem : region cut by slashes.
@domod4813 жыл бұрын
I am also looking for solution of this problem.
@ShiranAfergan3 жыл бұрын
Thank you! Since it is also a union find question, it might take some time (i wanna do some tree, graph and recursion questions first) but seems interesting, thanks! ☺️
@chintamalli6953 жыл бұрын
Awesome plz continue series with Google questions
@ShiranAfergan3 жыл бұрын
Thanks! I will :)
@akashgupta67112 жыл бұрын
Awesome explanation !! Can you please tell what is the drawing tool that you use ? I was thinking of using some kind of drawing tool for my virtual interviews.
@ShiranAfergan2 жыл бұрын
It’s an iPad pro with GoodNotes
@musicperson94z3 жыл бұрын
Awesome video. How can you be so good at this? Keep posting please.
@ShiranAfergan3 жыл бұрын
Thanks Jiadong! You just need to practice :)
@mudrad19302 жыл бұрын
It really helped ! Thanks a lot
@ShiranAfergan2 жыл бұрын
You’re welcome :)
@ishaankulkarni493 жыл бұрын
great explanation! :)
@ShiranAfergan3 жыл бұрын
Thanks :)
@deepusasidharan20123 жыл бұрын
Good explanation
@ShiranAfergan3 жыл бұрын
Thanks 😊
@interviewprep41813 жыл бұрын
Really nice explanation
@ShiranAfergan3 жыл бұрын
Thanks :) glad you liked it.
@adityamishra44583 жыл бұрын
It was superb ..... can you suggest how to come up with such way of solving how you thought of this problem. Can you suggest some good resources to study for interviews
@ShiranAfergan3 жыл бұрын
Thanks Aditya! I plan on doing a video with tips on how to approach such problems and maybe a series on data structures and common algorithms. For practicing I recommend LeetCode and GeeksforGeeks.
@manokumar893 жыл бұрын
@@ShiranAfergan +1
@adityajagtap43492 жыл бұрын
I have been going through all you videos in the list . Thanks for sharing all the knowledge . I couldn't understand how groups were created inside a constructor of union find , like in example 6 groups are created upfront . I understand union like maintain parent as : (item index , parent value) . But couldn't really visualize when item itself is combination of two numbers.
@adityajagtap43492 жыл бұрын
But I got it now , item is row and column individually and instead of indexing with array which we have generally use , we have a map also we don't care about stone but only its cordinates . Being from java background parent[col] gave me feeling of index instead of keys .
@ShiranAfergan2 жыл бұрын
I can see why it’s confusing:) I now code in Java in my job and I keep trying to use [] with maps and don’t understand why it’s not working 🙃
@akashingole2 жыл бұрын
Hi, why have you added 1 to row and column.
@javierfuentes36033 жыл бұрын
great explanation
@ShiranAfergan3 жыл бұрын
Thanks Javier!
@tsonnguyen Жыл бұрын
ur the best
@akashjaiswal64783 жыл бұрын
amazing explanation, thanks a lot, I have a doubt- when rank[xset]
@ShiranAfergan3 жыл бұрын
Thanks:) it’s not an error because you only care about the rank of the root (the representative of the set) and yset is now under xset so we only need to update the rank of xset
@tom39833 жыл бұрын
amazing! thank you
@ShiranAfergan3 жыл бұрын
I’m glad you liked it :) thanks for watching.
@nipunshah13732 жыл бұрын
Why rank was not updated during merging in rest 2 conditions ?
@amanverma73752 жыл бұрын
I am unable to understand what does count variable stores initially, can we do count = stones. size(); as well
@harshk33512 жыл бұрын
count will store the number of groups we have intially No, you can not do count = stones. size() this will be wrong just think over this example: [ [0, 0], [1,1], [2,2] ] here: count = stones. size() = 3 [WRONG] count = parent.size() = 6 [row0, col0, row1, col1 like that] [ CORRECT]
@DharmendraYadav-sf4ti4 жыл бұрын
Nice Explanation
@ShiranAfergan4 жыл бұрын
Thanks :)
@DharmendraYadav-sf4ti4 жыл бұрын
Welcome!!
@eg7eg72 жыл бұрын
Watched that video again, and I was about to comment when I saw that I already did a year ago haha :P
@ShiranAfergan2 жыл бұрын
Haha hope you enjoyed it the second time as well 😄
@eg7eg72 жыл бұрын
@@ShiranAfergan I did for sure :)
@ramanmanocha48003 жыл бұрын
That's smart!!
@letslive37822 жыл бұрын
How do you even get those ideas ? I could have never thought of this problem in this manner.
@ShiranAfergan2 жыл бұрын
Yes, it is a difficult question. The idea is to try reducing the problem to something familiar. In this case - number of connected components in a graph.
@letslive37822 жыл бұрын
@@ShiranAfergan Thank your very much, Shiran !!
@ritwik1213 жыл бұрын
can you make a video on this leetcode.com/problems/accounts-merge/ and can you more graph problems like this video. this video was very good. thanks
@ShiranAfergan3 жыл бұрын
Thanks Ritwik! I like your suggestion, i will add this question to my list. I think the next one is going to be “robot room cleaner”. Hope you enjoy it :)
@ritwik1213 жыл бұрын
@@ShiranAfergan thanks a lot
@pwnweb57342 жыл бұрын
Perfect. perfeect perfect peerrrfect
@ShiranAfergan2 жыл бұрын
Glad you liked it 😆😊
@yash_______1052 жыл бұрын
@@ShiranAfergan can u plz plz increase frequency of uploading videos
@akshaykhanna42953 жыл бұрын
So max stones that can be removed = Total stones - no of connected components
@ShiranAfergan3 жыл бұрын
Yup
@jethala1382 жыл бұрын
You are beautiful ;) Btw Thanks for the explanation😊
@ShiranAfergan2 жыл бұрын
Thanks and you’re welcome :) glad it helped
@shivamrai78383 жыл бұрын
thankuhh :) -/\-
@garrettguitar65834 жыл бұрын
union find? Amortzed what? Too difficult . I m not smart enough for this. Too hard. Where can I find a simple explanation of this ?
@ShiranAfergan4 жыл бұрын
Yes, it’s a difficult question. If you want to read up on union-find (Disjoint-set) data structure you can find a pretty detailed explanation on Wikipedia (en.wikipedia.org/wiki/Disjoint-set_data_structure ). You can also check out this Union-Find playlist from William Fiset kzbin.info/aero/PLDV1Zeh2NRsBI1C-mR6ZhHTyfoEJWlxvq
@praburajiiv3 жыл бұрын
i came up with solution within 3 min of this video. good at explaining different test cases. curious to know your instagram id 😍
@ShiranAfergan3 жыл бұрын
Awesome :) thanks for watching. I don’t have an active instagram account.