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

# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution(object):
def removeElements(self, head, val):
"""
:type head: ListNode
:type val: int
:rtype: ListNode
"""
chushihua = ListNode(-1)
chushihua.next = head
new = chushihua
while new.next:
if new.next.val == val:
new.next = new.next.next
else:
new = new.next
return chushihua.next
边栏推荐
- Lumiprobe non fluorescent alkyne EU (5-ethynyluridine)
- Classpath classpath
- [CF1476F]Lanterns
- PTA year of birth
- 解决方案:可以ping别人,但是别人不能ping我
- [CF559E]Gerald and Path
- R language uses follow up of epidisplay package Plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses n.of The lines parameter specifies the num
- Evaluation of 6 red, yellow and black list cameras: who is the safest? Who has good picture quality? From now on, let you no longer step on thunder
- [source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
- OpenAI|视频预训练 (VPT):基于观看未标记的在线视频的行动学习
猜你喜欢

Halcon image calibration enables subsequent image processing to become the same as the template image

Data query language (DQL)

主成分计算权重

t10_ Adapting to Market Participantsand Conditions

信度系数低怎么办?信度系数具体怎么算?

用WPF写一款开源方便、快捷的数据库文档查询、生成工具

Relational database management system of easyclick

PCL learning materials

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

2、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》启动并运行您的本地环境
随机推荐
OpenAI|视频预训练 (VPT):基于观看未标记的在线视频的行动学习
Introduction to easyclick database
Mysql database design
The ultimate version of the 13th simulation of the single chip microcomputer provincial competition of the Blue Bridge Cup
Blue Bridge Cup real problem: word analysis
字节跳动数据平台技术揭秘:基于 ClickHouse 的复杂查询实现与优化
[noip2015] jumping stone
540. Single element in ordered array / 1684 Count the number of consistent strings
GameFramework食用指南
Lumiprobe biomolecular quantification - qudye Protein Quantification Kit
Leetcode203 移除链表元素
After studying 11 kinds of real-time chat software, I found that they all have these functions
2、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》启动并运行您的本地环境
为什么独立站卖家都开始做社交媒体营销?原来客户转化率能提高这么多!
Regular expression
实现一个Prometheus exporter
Implement a Prometheus exporter
The 13th simulation problem of the single chip microcomputer provincial competition of the Blue Bridge Cup
540. Single element in ordered array
研究了11种实时聊天软件,我发现都具备这些功能…