public ListNode detectCycle(ListNode head) {
		if (head == null || head.next == null) return null;
		ListNode slow = head, fast = head;
		while (fast != null && fast.next != null) {
			slow = slow.next;
			fast = fast.next.next;
			if (fast == slow) break;
		}
		if (fast == slow) {
			ListNode n1 = head, n2 = slow;
			while(n1 != n2){
				n1 = n1.next;
				n2 = n2.next;
			}
			return n1;
		}
		return null;
	}