Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
adi berkowitz
I don't think the posted solution is really the one that should be used

adi berkowitz

Jun 18, 2024

Here is the solution that is clean and 100% be the official solution

class Solution: def findCycleStart(self, head): slow, fast = head, head while fast and fast.next: slow = slow.next fast = fast.next.next if fast == slow: break slow = head while slow != fast: fast = fast.next slow = slow.next return slow

6

0

Comments
Comments
Luis Roel
Luis Roela year ago

Agreed