当前位置:网站首页>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
边栏推荐
- How to find customers for investment attraction in industrial parks
- LeetCode 148. Sort linked list
- LiveData postValue会“丢”数据
- R语言ggplot2可视化:gganimate创建动态柱状图动画(gif)、在动画中沿给定维度逐步显示柱状图、enter_grow函数和enter_fade函数控制运动内插退出(渐变tweening)
- 力扣每日一题-第32天-1232. 缀点成线
- Calculation of intersection of two line segments
- Search 2D matrix 2
- 关于企业中台规划和 IT 架构微服务转型
- [image denoising] matlab code for removing salt and pepper noise based on fast and effective multistage selective convolution filter
- [noip2015] jumping stone
猜你喜欢

用GSConv+Slim Neck改进Yolov5,将性能提升到极致!

Lumiprobe非荧光炔烃丨EU(5-乙炔基尿苷)

How to find customers for investment attraction in industrial parks

How to manage 1000 anchors by one person?
![[image denoising] matlab code for removing salt and pepper noise based on fast and effective multistage selective convolution filter](/img/bf/f8759195ea67832835e84c851b5e81.jpg)
[image denoising] matlab code for removing salt and pepper noise based on fast and effective multistage selective convolution filter

斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测

Mise en place d'une plate - forme générale de surveillance et d'alarme, quelles sont les conceptions nécessaires dans l'architecture?

Static timing analysis (STA) in ic/fpga design

Three.js学习-相机Camera的基本操作(了解向)

力扣每日一题-第32天-589.N×树的前序遍历
随机推荐
2020,最新手机号码手机验证正则表达式,持续更新
The 13th simulation problem of the single chip microcomputer provincial competition of the Blue Bridge Cup
每周推薦短視頻:警惕“現象”與“問題”相互混淆
Privacy sandbox is finally coming
NSI packaging script add file details
R语言ggplot2可视化:gganimate包transition_time函数创建动态散点图动画(gif)、shadow_wake函数配置动画的渐变效果(gradual falloff)拖尾效应
Unity learning fourth week
用WPF写一款开源方便、快捷的数据库文档查询、生成工具
Leetcode203 移除链表元素
A database editing gadget that can edit SQLite database. SQLite database replaces fields. SQL replaces all values of a field in the database
C# SelfHost WebAPI (2)
Force buckle day33
LiveData postValue会“丢”数据
1380. Lucky number in matrix / 1672 Total assets of the richest customers
Static timing analysis (STA) in ic/fpga design
What if the reliability coefficient is low? How to calculate the reliability coefficient?
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
Lumiprobe non fluorescent alkyne EU (5-ethynyluridine)
力扣每日一题-第32天-1232. 缀点成线
Basic concepts of binary tree