当前位置:网站首页>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
边栏推荐
- Subnet division and summary
- Using OpenSSL encryption to rebound shell traffic
- Classpath classpath
- Introduction to easyclick database
- C operator overloads the query table
- Domestic spot silver should be understood
- Explain in detail the process of realizing Chinese text classification by CNN
- Zabbix报警执行远程命令
- Common design parameters of solid rocket motor
- Check log4j problems using stain analysis
猜你喜欢
主成分之综合竞争力案例分析
. Net cloud native architect training camp (permission system code implements actionaccess) -- learning notes
Penetration practice vulnhub range Keyring
12. Design of power divider for ads usage record
Penetration practice vulnhub range Tornado
Highly reliable program storage and startup control system based on anti fuse FPGA and QSPI flash
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
PCL learning materials
主成分计算权重
Penetration practice vulnhub range Nemesis
随机推荐
Roll out! Enlightenment!
主成分计算权重
Set the style of QT property sheet control
Highly reliable program storage and startup control system based on anti fuse FPGA and QSPI flash
網上股票開戶安全嗎?是否可靠?
Happy new year | 202112 monthly summary
Check log4j problems using stain analysis
Database - MySQL advanced SQL statement (I)
Rust language - cargo, crates io
This is the latest opportunity of the London bank trend
How to find the optimal learning rate
Apache iceberg source code analysis: schema evolution
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
Zabbix报警执行远程命令
Financial judgment questions
Mujoco model learning record
Sum of three numbers
Static timing analysis (STA) in ic/fpga design
Operation of cmake under win
Domestic spot silver should be understood