Great explanation for slow and fast pointers 👍 My solution to this problem was to reassign each node's value to 'seen'. And if I come up to a node that has value 'seen', then it must be in a loop
I was solving this problem in the wrong way, but today I've learned about slow and fast pointers and how to use them. Thanks! Another successful solution :)
Hi Greg! I'm just curious why create a dummy node at all? It seems like it works fine to just omit that and make slow = fast = head. Thanks for the video!
Great explanantion, really liking it so far. Concise solutions. Coming to this solution, I dont think we need to add a dummy node and start iterating from there, because as per Floyd's algo, they would eventually meet. In the example above, fast and slow would meet in second loop iteration, it's just more computation that's all. Let me know your thoughts.
Can I ask you something Greg. Are we supposed to think of solutions like this without tutorials? I find that humanly possible. I feel like im memorizing blind75 with understanding aswell but Im not sure if I'd be able to do any other problems (unless they're easy hashmap ones) Am I cooked for interviews or will the interviews most likely have blind75 type problems
It's just the situation that tech interviews are at, and it will just keep getting worse unfortunately. It is of course not valid, fair, or correct to expect someone to come up with this solution within 45 minutes (or less, depending on if there are follow-ups). No one in the world would be able to do it. This algorithm was devised by a computer science researcher and has a mathematical proof. So the absolute, only possible way to use this as a solution, is to have seen and practiced it before. So it's just a question of "hey have you seen this specific question before?"
Hey greg, was it always that easy for you to solve these problems ? I find it very difficult not to understan but to solve it on my own. btw your explanation is very good keep it up.
Master Data Structures & Algorithms For FREE at AlgoMap.io!
Great explanation for slow and fast pointers 👍 My solution to this problem was to reassign each node's value to 'seen'. And if I come up to a node that has value 'seen', then it must be in a loop
That's actually a great idea
I was solving this problem in the wrong way, but today I've learned about slow and fast pointers and how to use them. Thanks! Another successful solution :)
better than neetcode I cant even lie
😂
you and and neetcode should collab !
Hi Greg! I'm just curious why create a dummy node at all? It seems like it works fine to just omit that and make slow = fast = head. Thanks for the video!
Great explanantion, really liking it so far. Concise solutions.
Coming to this solution, I dont think we need to add a dummy node and start iterating from there, because as per Floyd's algo, they would eventually meet.
In the example above, fast and slow would meet in second loop iteration, it's just more computation that's all. Let me know your thoughts.
Can I ask you something Greg. Are we supposed to think of solutions like this without tutorials? I find that humanly possible. I feel like im memorizing blind75 with understanding aswell but Im not sure if I'd be able to do any other problems (unless they're easy hashmap ones) Am I cooked for interviews or will the interviews most likely have blind75 type problems
It's okay to memorize for a while, often the blind 75 teaches new important algorithms that you wouldn't come up with on your own
It's just the situation that tech interviews are at, and it will just keep getting worse unfortunately. It is of course not valid, fair, or correct to expect someone to come up with this solution within 45 minutes (or less, depending on if there are follow-ups). No one in the world would be able to do it. This algorithm was devised by a computer science researcher and has a mathematical proof. So the absolute, only possible way to use this as a solution, is to have seen and practiced it before. So it's just a question of "hey have you seen this specific question before?"
awesome !
very good explanation ! Thanks !
Hey greg, was it always that easy for you to solve these problems ?
I find it very difficult not to understan but to solve it on my own.
btw your explanation is very good keep it up.
Lol definitely not easy at first, don't worry:)
Why it has O(n) time complex ?
Great explanation
Thank you so much :)