当前位置:网站首页>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
边栏推荐
- About enterprise middle office planning and it architecture microservice transformation
- 用WPF写一款开源方便、快捷的数据库文档查询、生成工具
- 6款红黄黑榜摄像头评测:谁最安全?谁画质好?从此让你不再踩雷
- Must see, time series analysis
- Lumiprobe non fluorescent alkyne EU (5-ethynyluridine)
- 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
- Is the fund of futures account safe? How to open an account?
- The ultimate version of the 13th simulation of the single chip microcomputer provincial competition of the Blue Bridge Cup
- R language epidisplay package ordinal or. The display function obtains the summary statistical information of the ordered logistic regression model (the odds ratio and its confidence interval correspo
- Depth first search - DFS (burst search)
猜你喜欢
斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测
C# SelfHost WebAPI (2)
Localization through custom services in the shuttle application
每周推荐短视频:警惕“现象”与“问题”相互混淆
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
Basic knowledge and commands of disk
How to find the optimal learning rate
Mysql database of easyclick
Relational database management system of easyclick
信度系数低怎么办?信度系数具体怎么算?
随机推荐
如何运营好技术相关的自媒体?
斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测
Leetcode203 移除链表元素
Database - MySQL advanced SQL statement (I)
R语言使用dplyr包的transmute函数计算dataframe数据中的指定数据列的移动窗口均值、使用ggplot2包可视化移动均值与原始数据的折线图
About enterprise middle office planning and it architecture microservice transformation
[CF559E]Gerald and Path
Halcon image calibration enables subsequent image processing to become the same as the template image
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
Mise en place d'une plate - forme générale de surveillance et d'alarme, quelles sont les conceptions nécessaires dans l'architecture?
What impact will multinational encryption regulation bring to the market in 2022
Introduction to easyclick database
R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graph, and uses PCH parameters to customize the shape o
Leetcode-128 最长连续序列
R language uses the aggregate function of epidisplay package to divide numerical variables into different subsets based on factor variables, and calculate the summary statistics of each subset
Blue Bridge Cup real topic: the shortest circuit
字节跳动数据平台技术揭秘:基于 ClickHouse 的复杂查询实现与优化
Principal component calculation weight
[image denoising] matlab code for removing salt and pepper noise based on fast and effective multistage selective convolution filter
每周推荐短视频:警惕“现象”与“问题”相互混淆