当前位置:网站首页>Leetcode-160 intersecting linked list
Leetcode-160 intersecting linked list
2022-07-01 18:47:00 【It was the sea】
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def getIntersectionNode(self, headA, headB):
"""
:type head1, head1: ListNode
:rtype: ListNode
"""
p, q = headA, headB
while not p == q:
p = p.next if p else headB
q = q.next if q else headA
return p
边栏推荐
- Sanfeng cloud 0215 I often use
- Mysql database of easyclick
- 力扣每日一题-第32天-1232. 缀点成线
- Case study on comprehensive competitiveness of principal components
- Single element of an ordered array
- How to find the optimal learning rate
- LeetCode 148. Sort linked list
- 6款红黄黑榜摄像头评测:谁最安全?谁画质好?从此让你不再踩雷
- C language learning notes: type definition typedef and declaration external CSDN creation punch in
- After studying 11 kinds of real-time chat software, I found that they all have these functions
猜你喜欢
2、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》启动并运行您的本地环境
Lumiprobe 双功能交联剂丨Sulfo-Cyanine5 双-NHS 酯
[today in history] February 15: Pascal's father was born; YouTube was founded; Kotlin language comes out
Localization through custom services in the shuttle application
Halcon图片标定,使得后续图片处理过后变成与模板图片一样
Mise en place d'une plate - forme générale de surveillance et d'alarme, quelles sont les conceptions nécessaires dans l'architecture?
Lumiprobe非荧光炔烃丨EU(5-乙炔基尿苷)
关于企业中台规划和 IT 架构微服务转型
Image acquisition and playback of coaxpress high speed camera based on pxie interface
LiveData postValue会“丢”数据
随机推荐
Five degrees easy chain enterprise app is newly upgraded
Write it down once Net travel management background CPU Explosion Analysis
Halcon图片标定,使得后续图片处理过后变成与模板图片一样
After studying 11 kinds of real-time chat software, I found that they all have these functions
Localization through custom services in the shuttle application
Draw drawing process of UI drawing process
Using OpenSSL encryption to rebound shell traffic
PMP daily three questions (February 15, 2022)
创建您自己的NFT集合并发布一个Web3应用程序来展示它们(介绍)
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用n.of.lines参数指定显示的病例数
搭建一个通用监控告警平台,架构上需要有哪些设计
540. Single element in ordered array
What designs are needed in the architecture to build a general monitoring and alarm platform
1380. Lucky number in matrix / 1672 Total assets of the richest customers
Android development interview was badly hit in 3 years, and now the recruitment technical requirements are so high?
OpenAI|视频预训练 (VPT):基于观看未标记的在线视频的行动学习
Cloud computing - make learning easier
LeetCode 148. Sort linked list
关于企业中台规划和 IT 架构微服务转型
12种数据量纲化处理方式