当前位置:网站首页>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
边栏推荐
- Vue uses keep alive to cache page optimization projects
- Must see, time series analysis
- Lumiprobe Lumizol RNA 提取试剂解决方案
- Halcon image calibration enables subsequent image processing to become the same as the template image
- Rust language - cargo, crates io
- 搭建一个通用监控告警平台,架构上需要有哪些设计
- 如何运营好技术相关的自媒体?
- Principal component calculation weight
- What designs are needed in the architecture to build a general monitoring and alarm platform
- AI 训练速度突破摩尔定律;宋舒然团队获得RSS 2022最佳论文奖
猜你喜欢

Lumiprobe 双功能交联剂丨Sulfo-Cyanine5 双-NHS 酯

12. Design of power divider for ads usage record

540. Single element in ordered array

Go Technology Daily (2022-02-14) - go language slice interview real questions 8 consecutive questions

Data query language (DQL)

Navicat Premium 15 永久破解和2021版本最新IDEA破解(亲测有效)

Bernoulli distribution (a discrete distribution)

Computer network interview assault

Xia CaoJun ffmpeg 4.3 audio and video foundation to engineering application

How does factor analysis calculate weights?
随机推荐
记一次 .NET 差旅管理后台 CPU 爆高分析
Sanfeng cloud 0215 I often use
Memo - about C # generating barcode for goods
MySQL connection tools
R语言ggplot2可视化:可视化折线图、使用labs函数为折线图添加自定义的Y轴标签信息(customize y axis label)
Regular expression
The R language cartools package divides the data, the scale function scales the data, the KNN function of the class package constructs the k-nearest neighbor classifier, and the table function calcula
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
用GSConv+Slim Neck改进Yolov5,将性能提升到极致!
磁盘的基本知识和基本命令
Halcon image calibration enables subsequent image processing to become the same as the template image
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
How to find customers for investment attraction in industrial parks
PCL learning materials
Livedata postvalue will "lose" data
The 13th simulation problem of the single chip microcomputer provincial competition of the Blue Bridge Cup
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
What impact will multinational encryption regulation bring to the market in 2022
A wonderful time to buy and sell stocks
Database - MySQL advanced SQL statement (I)