当前位置:网站首页>Linked list 5 - 234 Palindrome linked list
Linked list 5 - 234 Palindrome linked list
2022-06-23 11:57:00 【Artificial intelligence Zeng Xiaojian】

class Solution:
def isPalindrome(self,head:ListNode) -> bool:
vals= []
current_node =head
while current_node is not None:
vals.append(current_node.val)
current_node = current_node.next
return vals ==vals[::-1]class Solution:
def isPalindrome(self,head:ListNode) ->bool:
vals= []
current_node =head
while current_node is not None:
vals.append(current_node.val)
current_node = current_node.next
return vals ==vals[::-1]边栏推荐
猜你喜欢

Halcon原理:auto_threshold算子

爱可可AI前沿推介(6.23)

Simulation questions and answers of the latest national fire-fighting facility operators (primary fire-fighting facility operators) in 2022

Redis 入门-第一篇-数据结构与对象-简单动态字符串(SDS)

并购增资或将有望启动东软越通新动能?

2022年全国最新消防设施操作员(初级消防设施操作员)模拟题及答案

Invalid Navicat scheduled task

2光2电级联型光纤收发器千兆2光2电光纤收发器迷你嵌入式工业矿用本安型光纤收发器

Use monotone stack to solve problems

Meta said that the UK security law may "scan all private information" or infringe privacy
随机推荐
手机证券开户交易?现在网上开户安全么?
Surprise! Amd acquires Xilinx with USD 35billion!
QT知识:Qt Widgets小部件函数【02】
Halcon知识:binocular_disparity 知识
Mysql, how to calculate the maximum value using stored procedures
如何使用笔记软件 FlowUs、Notion 进行间隔重复?基于公式模版
Use monotone stack to solve problems
过采样系列三:量化误差与过采样率
[comprehensive written test questions] 30 Concatenate substrings of all words
Internet miracle - how does Xiaomi make profits
『忘了再学』Shell流程控制 — 39、特殊流程控制语句
Three ways to learn at work
Getting started with redis - Chapter 4 - data structures and objects - jump table
【零基础微信小程序】基于百度大脑人像分割的证件照换底色小程序实战开发
Learning notes sweep crawler framework
Qt知识:视图框架QGraphicsWidget详解
How to use note taking software flowus and note for interval repetition? Based on formula template
Leetcode 1209. 删除字符串中的所有相邻重复项 II(初版本没过)
理财产品的赎回时间有规定吗?
Blue Bridge Cup single chip microcomputer (I) -- turn off peripherals and turn off led