当前位置:网站首页>LinkedList 5-141. Circular linked list
LinkedList 5-141. Circular linked list
2022-06-23 11:57:00 【Artificial intelligence Zeng Xiaojian】
class Solution:
def hasCycle(self, head: ListNode) -> bool:
seen = set()
while head:
if head in seen:
return True
seen.add(head)
head = head.next
return False
class Solution:
def hasCycle(self,head:ListNode) ->bool:
seen=set()
while head:
if head in seen:
return True
seen.add(head)
head = head.next
return False边栏推荐
- 一张图解码 OpenCloudOS 社区开放日
- CIFAR公开第二阶段泛加拿大AI战略
- php 手写一个完美的守护进程
- Creating neural networks using tensorflow2
- 有没有碰到过flink1.15.0 和 flink-cdc-mysql 2.2.1不兼容的情况?f
- 爱可可AI前沿推介(6.23)
- Leetcode 1209. 删除字符串中的所有相邻重复项 II(牛逼,终于过了)
- Meta said that the UK security law may "scan all private information" or infringe privacy
- 【云驻共创】无码时代,软件开发如何走向每个人?
- 使用单调栈解题
猜你喜欢
随机推荐
ROS2知识(2):网络设施
Creating neural networks using tensorflow2
32路电话+2路千兆以太网32路PCM电话光端机支持FXO口FXS语音电话转光纤
[cloud based co creation] overview of the IOT of Huawei cloud HCIA IOT v2.5 training series
ESP32-C3入门教程 问题篇⑦—— fatal error: esp_bt.h: No such file or directory 找不到esp_bt.h
想学习eTS开发?教你开发一款IQ-EQ测试应用
halcon原理:一维函数function_1d类型【2】
Redis 入门-第二篇-数据结构与对象-链表
Blue Bridge Cup single chip microcomputer (I) -- turn off peripherals and turn off led
十大劵商如何开户?在线开户安全么?
Ppt makes 3D rotation animation from beginner to advanced
wc 统计已过时,cloc 每一行代码都有效
汉源高科新一代绿色节能以太网接入工业交换机高效节能型千兆工业以太网交换机
How does easygbs solve the abnormal use of intercom function?
QT5知识:信号和槽的一些要点
2022工具钳工(初级)考试练习题模拟考试平台操作
【云驻共创】华为云HCIA-IoT V2.5培训系列内容之物联网概览
请问连接oracle时,这个version 1.54 是什么的version?
Getting started with redis - Chapter 2 - data structures and objects - linked lists
Redis 入门-第一篇-数据结构与对象-简单动态字符串(SDS)









