:type head1, head1: ListNode :rtype: ListNode
(self, headA, headB)
| 89 | |
| 90 | class Solution(object): |
| 91 | def getIntersectionNode(self, headA, headB): |
| 92 | """ |
| 93 | :type head1, head1: ListNode |
| 94 | :rtype: ListNode |
| 95 | """ |
| 96 | |
| 97 | a = headA |
| 98 | b = headB |
| 99 | |
| 100 | if not a or not b: |
| 101 | return None |
| 102 | |
| 103 | while a != b: |
| 104 | |
| 105 | a = headB if a is None else a.next |
| 106 | b = headA if b is None else b.next |
| 107 | |
| 108 | return a |
nothing calls this directly
no outgoing calls
no test coverage detected