当前位置:网站首页>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
边栏推荐
- Basic concepts of binary tree
- Roll out! Enlightenment!
- Livedata postvalue will "lose" data
- Blue Bridge Cup real problem: word analysis
- LeetCode-21合并两个有序链表
- Database - MySQL advanced SQL statement (I)
- Leetcode-141环形链表
- PMP daily three questions (February 15, 2022)
- 力扣每日一题-第32天-589.N×树的前序遍历
- Lumiprobe 生物分子定量丨QuDye 蛋白定量试剂盒
猜你喜欢
Bernoulli distribution (a discrete distribution)
LiveData postValue会“丢”数据
[image denoising] matlab code for removing salt and pepper noise based on fast and effective multistage selective convolution filter
Write an open source, convenient and fast database document query and generation tool with WPF
Unity learning fourth week
每周推薦短視頻:警惕“現象”與“問題”相互混淆
Cloud computing - make learning easier
Case study on comprehensive competitiveness of principal components
Memo - about C # generating barcode
Evaluation of 6 red, yellow and black list cameras: who is the safest? Who has good picture quality? From now on, let you no longer step on thunder
随机推荐
Bernoulli distribution (a discrete distribution)
Draw drawing process of UI drawing process
研究了11种实时聊天软件,我发现都具备这些功能…
PCL learning materials
After studying 11 kinds of real-time chat software, I found that they all have these functions
Is it safe to open a securities account? Is there any danger
The 13th simulation problem of the single chip microcomputer provincial competition of the Blue Bridge Cup
Navicat premium 15 permanent cracking and 2021 latest idea cracking (valid for personal testing)
Qt中的QFile读写文件操作
AI 训练速度突破摩尔定律;宋舒然团队获得RSS 2022最佳论文奖
Lumiprobe biomolecular quantification - qudye Protein Quantification Kit
Data query language (DQL)
R language uses the transmute function of dplyr package to calculate the moving window mean value of the specified data column in dataframe data, and uses ggplot2 package to visualize the line graph b
540. Single element in ordered array / 1684 Count the number of consistent strings
1380. Lucky number in matrix / 1672 Total assets of the richest customers
Lumiprobe 生物分子定量丨QuDye 蛋白定量试剂盒
Go Technology Daily (2022-02-14) - go language slice interview real questions 8 consecutive questions
Leetcode-128 最长连续序列
LeetCode-21合并两个有序链表
How to find customers for investment attraction in industrial parks