[题目地址](https://leetcode.cn/problems/linked-list-cycle/) + 快慢指针 ```go /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func hasCycle(head *ListNode) bool { slow, fast := head, head for fast != nil && fast.Next != nil{ slow = slow.Next fast = fast.Next.Next if slow == fast{ return true } } return false } ```