当前位置:网站首页>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
边栏推荐
- PMP daily three questions (February 15, 2022)
- The ultimate version of the 13th simulation of the single chip microcomputer provincial competition of the Blue Bridge Cup
- (6) VIM editor MV cat redirection standard input and output more pipe symbols head tail
- Write an open source, convenient and fast database document query and generation tool with WPF
- Livedata postvalue will "lose" data
- 540. Single element in ordered array / 1684 Count the number of consistent strings
- Classpath classpath
- NSI packaging script add file details
- 必看,时间序列分析
- The R language uses the tablestack function of epidisplay package to make statistical summary tables (descriptive statistics based on the grouping of target variables, hypothesis testing, etc.). If th
猜你喜欢

搭建一个通用监控告警平台,架构上需要有哪些设计
![[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

How to manage 1000 anchors by one person?

Memo - about C # generating barcode for goods

如何在自有APP内实现小程序实现连麦直播

LeetCode-21合并两个有序链表

1380. Lucky number in matrix / 1672 Total assets of the richest customers

Why do independent website sellers start to do social media marketing? The original customer conversion rate can be improved so much!

Navicat Premium 15 永久破解和2021版本最新IDEA破解(亲测有效)
![[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)](/img/92/f3a70e7086aeedf41eea3eef98b5aa.jpg)
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
随机推荐
Image acquisition and playback of coaxpress high speed camera based on pxie interface
Lumiprobe biomolecular quantification - qudye Protein Quantification Kit
必看,时间序列分析
NSI packaging script add file details
Blue Bridge Cup real topic: the shortest circuit
Basic knowledge and commands of disk
What if the reliability coefficient is low? How to calculate the reliability coefficient?
How to find customers for investment attraction in industrial parks
Is it safe to open a securities account? Is there any danger
Halcon image calibration enables subsequent image processing to become the same as the template image
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用n.of.lines参数指定显示的病例数
如何运营好技术相关的自媒体?
隐私沙盒终于要来了
How to change guns for 2D characters
Blue Bridge Cup real problem: word analysis
Navicat premium 15 permanent cracking and 2021 latest idea cracking (valid for personal testing)
code
R语言ggplot2可视化:gganimate包transition_time函数创建动态散点图动画(gif)、shadow_wake函数配置动画的渐变效果(gradual falloff)拖尾效应
Technology implementation and Architecture Practice
用WPF写一款开源方便、快捷的数据库文档查询、生成工具