Hey everyone. Check out this in-depth solution for leetcode 21.
Пікірлер: 35
@indiajackson59592 жыл бұрын
I have an interview with Google and your style of teaching the foundations and patterns speak to the mathematician in me!! You deserves more views!!
@andygala8882 жыл бұрын
Glad the vids are helpful :)
@ayshasinara47462 жыл бұрын
yeah I agree with you 👍
@OnEwHoRiDesLinEs9 ай бұрын
did you get the job at Google
@indiajackson59599 ай бұрын
Nope lol@@OnEwHoRiDesLinEs
@Grahammpatton2 жыл бұрын
wow this is the best explanation. That really made me realize exactly how simple the solution is. thank you!
@fernandosalas48852 жыл бұрын
The best explanation ever. Thanks
@JoseLopez-wh7xe2 жыл бұрын
Excellent, very well explained! I would say that he made it look too easy, he could have left us more so that we could deduce it ourselves, but he left everything explicit. 😊
@pinpon1632 жыл бұрын
I don't know if it is me, but it seems that the way the Linked List is implemented for this problem is not very intuitive. I am not talking about your solution, but the two lists they are giving us.
@kazno42732 жыл бұрын
Definitely not intuitive. I'm also struggling to understand the design of linkedNode rather than the question itself
@berkantasci88112 жыл бұрын
Interesting to think this was an exam question in my first year and companies like amazon and google use it in their interviews. Especially because my school was and still is kind of shit
@JaredFL2 жыл бұрын
I'm not understanding why dummy is returned instead of prev? Since prev holds the order we set
@nicolasteofilo2 жыл бұрын
I'm not understanding too
@jenniferfan81552 жыл бұрын
I have the same question.
@sammi841017 Жыл бұрын
I had the same question as well, but then I logged it and think that because prev was only the one we use to track the 'current node value' We get null for prev.next and prev itself is [4]
@HEBUSTORLL Жыл бұрын
Basically dummy is linked and gets the pushes along the way, while prev acts like an index whosz value gets reset every time to keep track of where we're at. Returning prev would be the same as having a for loop, and returning [i]
@mrawesome1821 Жыл бұрын
It's a little quiet, but great video. Thank you Andy!
@quangtrungo6146 Жыл бұрын
Thanks very much , keep doing bro.
@kirillzlobin7135 Жыл бұрын
Maaan you are the legend
@Meowthrzy Жыл бұрын
I'm having a hard time on this problem thanks!
@stephanieonyekaba82742 жыл бұрын
This was very helpful ! can you zoom in a bit for future vids ? The text is kinda small :/
@anaelennaemeka4078 Жыл бұрын
Thanks Very much
@eshw23 Жыл бұрын
For the first output on leetcode, why the heck does it return the whole list when it is just asking for the head? That makes literlaly no sense.
@Supersoaker-xy2cr2 жыл бұрын
damn thanks bro
@cmdv42 Жыл бұрын
💯✨
@Wanderlustclusterfuck2 жыл бұрын
hey, i have a question. i thought it said you can go from -100 to 100. why did you do -infinity?
@nid302 жыл бұрын
Yes, it is quite unclear what negative infinity is doing there and what is its job?! Someone please clarifyyyy... 😢😢😭😭
@junjun22able2 жыл бұрын
@@nid30 It just a dummy, and as he said "You can set to anything". He just set it to -Infinity cause it's the lowest value in JS and just to make sense but actually you can put anything to it like 0, 100, 1000 cause it doesn't matter anyway. You will not returning this node value, only those nodes after it which is the dummy.next. I hope, I explained it well. ^___^
@nicolasteofilo2 жыл бұрын
@@junjun22able great explanation
@Supersoaker-xy2cr2 жыл бұрын
@@junjun22able so its just a declared head?
@melanieprevot49262 жыл бұрын
Hi, thank you for the video. Just one thing: why prev = dummy but we cannot return prev.next ? Not quite understand dummy part.
@HEBUSTORLL Жыл бұрын
Because the value of prev gets re set on every loop to keep the track. Dummy is a linked node list, so it's like an empty string that you fill as loops resolves, and prev is just the index
@surajpadalkar1670 Жыл бұрын
always remember if you lose your head the linked list is useless dummy is for that purpose only never lose the head of linked list as your previous is updated after every iteration it cant store it so to keep track of your head dummy is used