当前位置:网站首页>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
边栏推荐
- 必看,时间序列分析
- Data query language (DQL)
- C# SelfHost WebAPI (2)
- Three.js学习-相机Camera的基本操作(了解向)
- Lumiprobe 双功能交联剂丨Sulfo-Cyanine5 双-NHS 酯
- The R language uses the tablestack function of epidisplay package to make statistical summary tables (descriptive statistics based on the grouping of target variables, hypothesis testing, etc.). If th
- 如何在自有APP内实现小程序实现连麦直播
- Popular science: what does it mean to enter the kernel state?
- 主成分计算权重
- Blue Bridge Cup real problem: word analysis
猜你喜欢
PCL learning materials
Android development interview was badly hit in 3 years, and now the recruitment technical requirements are so high?
Principal component calculation weight
Leetcode-128 最长连续序列
Cloud computing - make learning easier
Implement a Prometheus exporter
Memo - about C # generating barcode for goods
1、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》什么是NFT
Basic knowledge and commands of disk
Basic concepts of binary tree
随机推荐
Operation of cmake under win
Android development interview was badly hit in 3 years, and now the recruitment technical requirements are so high?
A database editing gadget that can edit SQLite database. SQLite database replaces fields. SQL replaces all values of a field in the database
如何在自有APP内实现小程序实现连麦直播
12种数据量纲化处理方式
Facebook聊单,SaleSmartly有妙招!
MySQL connection tools
About enterprise middle office planning and it architecture microservice transformation
斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测
Lumiprobe 双功能交联剂丨Sulfo-Cyanine5 双-NHS 酯
Implementation of converting PCM file to WAV
用WPF写一款开源方便、快捷的数据库文档查询、生成工具
[CF1476F]Lanterns
Leetcode-160相交链表
Privacy sandbox is finally coming
GAMES202作业0-环境搭建过程&解决遇到的问题
Write an open source, convenient and fast database document query and generation tool with WPF
Reading notes series "modern methods of C language programming" -- Chapter 2
Lumiprobe 生物分子定量丨QuDye 蛋白定量试剂盒
3、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》在本地铸造 NFT