当前位置:网站首页>Leetcode-141 circular linked list
Leetcode-141 circular linked list
2022-07-01 18:47:00 【It was the sea】

class Solution(object):
def hasCycle(self, head):
"""
:type head: ListNode
:rtype: bool
"""
cur = head
res = set()
while cur:
node = cur
if node not in res:
cur = cur.next
res.add(node)
else:
return True
return False
边栏推荐
- Leetcode-128 最长连续序列
- Leetcode203 移除链表元素
- (6) VIM editor MV cat redirection standard input and output more pipe symbols head tail
- 信度系数低怎么办?信度系数具体怎么算?
- Lumiprobe 生物分子定量丨QuDye 蛋白定量试剂盒
- MySQL connection tools
- How to find customers for investment attraction in industrial parks
- Leetcode-160相交链表
- Blue Bridge Cup real problem: word analysis
- Basic knowledge and commands of disk
猜你喜欢

How to find the optimal learning rate

2、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》启动并运行您的本地环境

LeetCode 148. Sort linked list

Lumiprobe biomolecular quantification - qudye Protein Quantification Kit

Vidéos courtes recommandées chaque semaine: méfiez - vous de la confusion entre « phénomène » et « problème »

Search 2D matrix 2

12 data dimensioning processing methods

Android development interview was badly hit in 3 years, and now the recruitment technical requirements are so high?

解决方案:可以ping别人,但是别人不能ping我

Calculation of intersection of two line segments
随机推荐
How to change guns for 2D characters
Mysql database design
Data query language (DQL)
Five degrees easy chain enterprise app is newly upgraded
How to manage 1000 anchors by one person?
Popular science: what does it mean to enter the kernel state?
How to operate technology related we media well?
(6) VIM editor MV cat redirection standard input and output more pipe symbols head tail
R语言使用epiDisplay包的aggregate函数将数值变量基于因子变量拆分为不同的子集,计算每个子集的汇总统计信息
Database - MySQL advanced SQL statement (I)
Leetcode-83 删除排序链表中重复的元素
宏观视角看抖音全生态
Qt中的QFile读写文件操作
Weekly recommended short videos: be alert to the confusion between "phenomena" and "problems"
Search 2D matrix 2
Write an open source, convenient and fast database document query and generation tool with WPF
LeetCode-21合并两个有序链表
Force buckle day33
A wonderful time to buy and sell stocks
Implement a Prometheus exporter