Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无环链表相交 解法太复杂 #6

Open
zqiang3 opened this issue Jun 1, 2019 · 1 comment
Open

无环链表相交 解法太复杂 #6

zqiang3 opened this issue Jun 1, 2019 · 1 comment

Comments

@zqiang3
Copy link

zqiang3 commented Jun 1, 2019

No description provided.

@zqiang3
Copy link
Author

zqiang3 commented Jun 1, 2019

class Solution(object):
    def getIntersectionNode(self, headA, headB):   
                
        cura, curb = headA, headB
        
        while cura is not curb:
            cura = cura.next if cura else headB
            curb = curb.next if curb else headA
                                
        return cura

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant