141. Linked List Cycle 发表于 2021-12-19 1234567891011121314public class Solution { public boolean hasCycle(ListNode head) { ListNode fast = head, slow = head; while (fast != null && fast.next != null) { fast = fast.next.next; slow = slow.next; if (fast == slow) { return true; } } return false; }} Reference141. Linked List Cycle