Skip to content

Instantly share code, notes, and snippets.

@biningo
Last active November 11, 2020 14:55
Show Gist options
  • Save biningo/6012b6ebda9ca4855c2a05ed2afa4fef to your computer and use it in GitHub Desktop.
Save biningo/6012b6ebda9ca4855c2a05ed2afa4fef to your computer and use it in GitHub Desktop.
love
p1 = headA;p2 = headB
while p1!=p2: #速度一样 路程一样 最终一定会相遇 ♥
p1,p2 = headB if p1==None else p1.next,headA if p2==None else p2.next
return p1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment