public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
		int lenA = 0, lenB = 0;
		ListNode head = headA;
		while (head != null) {
			head = head.next;
			++lenA;
		}
		head = headB;
		while (head != null) {
			head = head.next;
			++lenB;
		}
		if (lenA > lenB) {
			while (lenA - lenB > 0) {
				headA = headA.next;
				--lenA;
			}
		} else if (lenA < lenB) {
			while (lenB - lenA > 0) {
				headB = headB.next;
				--lenB;
			}
		}
		while (headA != null) {
			if (headA == headB)
				return headA;
			headA = headA.next;
			headB = headB.next;
		}
		return null;
	}