当前位置:网站首页>Leetcode-160相交链表
Leetcode-160相交链表
2022-07-01 18:33:00 【原来是大海】

# 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
边栏推荐
- On the language internationalization of Yongzhong Office
- Leetcode 1380. Lucky numbers in the matrix (save the minimum number of each row and the maximum number of each column)
- D @ safety and dip1000
- How to change guns for 2D characters
- PMP daily three questions (February 15, 2022)
- Batch export all pictures in PPT in one second
- L'ouverture d'un compte d'actions en ligne est - elle sécurisée? Fiable?
- Equipment simulation and deduction training system software
- Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
- Talk about the favorite tools used by project managers
猜你喜欢

Explain in detail the process of realizing Chinese text classification by CNN

Fix the black screen caused by iPhone system failure

What impact will multinational encryption regulation bring to the market in 2022

Mysql database design

Common design parameters of solid rocket motor

Leetcode 1380. Lucky numbers in the matrix (save the minimum number of each row and the maximum number of each column)

Mujoco's biped robot Darwin model

Database - MySQL advanced SQL statement (I)

Force buckle day33

Apache iceberg source code analysis: schema evolution
随机推荐
At present, where is the most formal and safe account opening for futures speculation? How to open a futures account?
Fix the problem that easycvr device video cannot be played
PCL learning materials
Fresh, 2022 advanced Android interview must know 100 questions (interview questions + answer analysis)
EasyCVR通过国标GB28181协议接入设备,出现设备自动拉流是什么原因?
Using OpenSSL encryption to rebound shell traffic
How to find the optimal learning rate
What is web application security testing technology?
Mujoco's biped robot Darwin model
Three dimensional anti-terrorism Simulation Drill deduction training system software
[today in history] February 15: Pascal's father was born; YouTube was founded; Kotlin language comes out
Cloud picture says | distributed transaction management DTM: the little helper behind "buy buy buy"
Penetration practice vulnhub range Nemesis
The latest intelligent factory MES management system software solution
[image denoising] matlab code for removing salt and pepper noise based on fast and effective multistage selective convolution filter
How to change guns for 2D characters
Is online stock account opening safe? Is it reliable?
Five degrees easy chain enterprise app is newly upgraded
How to retrieve the password for opening Excel files
A database editing gadget that can edit SQLite database. SQLite database replaces fields. SQL replaces all values of a field in the database