https://www.cnblogs.com/bonelee/p/11789330.html

5个模板

    """
    def hasCycle(self, head):
        # write your code here
        slow, fast = head, head
        while fast and fast.next and fast.next.next:
            slow = slow.next
            fast = fast.next.next
			if slow == fast:
			   return True
        return False

  

相关文章:

  • 2021-05-23
  • 2021-11-22
  • 2022-12-23
  • 2021-10-14
  • 2021-09-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2021-11-25
  • 2021-11-04
相关资源
相似解决方案