Python | Leetcode Python题解之第160题相交链表

题目:

题解:

class Solution:
    def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
        A, B = headA, headB
        while A != B:
            A = A.next if A else headB
            B = B.next if B else headA
        return A

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-18 13:10:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-18 13:10:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-06-18 13:10:01       87 阅读
  4. Python语言-面向对象

    2024-06-18 13:10:01       96 阅读

热门阅读

  1. Ubuntu服务器的GitLab部署

    2024-06-18 13:10:01       34 阅读
  2. C++ 二叉搜索树【面试】

    2024-06-18 13:10:01       38 阅读
  3. 深入解析PHP函数

    2024-06-18 13:10:01       31 阅读
  4. Python关闭exe文件

    2024-06-18 13:10:01       34 阅读
  5. camx-打开相机预览hal3接口流程

    2024-06-18 13:10:01       37 阅读
  6. 【杂记-浅谈虚拟类型终端VTY用户界面】

    2024-06-18 13:10:01       33 阅读
  7. MongoDB 索引

    2024-06-18 13:10:01       35 阅读
  8. 007、绘制数据plt.plot

    2024-06-18 13:10:01       30 阅读
  9. Android开发lmageButton与Button控件区别

    2024-06-18 13:10:01       36 阅读
  10. Vue局部组件

    2024-06-18 13:10:01       36 阅读
  11. 深入理解HTTP协议——针对TCP的优化建议

    2024-06-18 13:10:01       36 阅读