@@ -0,0 +1,1201 @@
+package com.netease.kaola.act.compose;%0A%0Apublic class Linked_list_cycle_ii %7B%0A%0A    public static class ListNode %7B%0A        int val;%0A        ListNode next;%0A%0A        ListNode(int x) %7B%0A            val = x;%0A            next = null;%0A        %7D%0A%0A        ListNode(int x, ListNode next) %7B%0A            this.val = x;%0A            this.next = next;%0A        %7D%0A    %7D%0A%0A    public ListNode detectCycle(ListNode head) %7B%0A        if (head == null %7C%7C head.next == null) %7B%0A            return null;%0A        %7D%0A        if (head.next == head) %7B%0A            return head;%0A        %7D%0A        ListNode slow = head;%0A        ListNode fast = head;%0A        while (slow != null && fast != null && fast.next != null) %7B%0A            slow = slow.next;%0A            fast = fast.next.next;%0A            if (slow == fast) %7B%0A                break;%0A            %7D%0A        %7D%0A        if (slow == null %7C%7C fast == null) %7B%0A            return null;%0A        %7D%0A        if (slow == head) %7B%0A            return head;%0A        %7D%0A        for (slow = head; slow != null && fast != null; ) %7B%0A            slow = slow.next;%0A            fast = fast.next;%0A            if (slow == fast) %7B%0A                return slow;%0A            %7D%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A%0A%0A

Add file Linked_list_cycle_ii.java