当前位置:网站首页>Leetcode-83 delete duplicate elements in the sorting linked list
Leetcode-83 delete duplicate elements in the sorting linked list
2022-07-01 18:47:00 【It was the sea】

class Solution(object):
def deleteDuplicates(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
if not head : return
cur = head
while cur.next:
if cur.val == cur.next.val:
cur.next = cur.next.next
else:
cur = cur.next
return head
边栏推荐
- Leetcode203 移除链表元素
- Memo - about C # generating barcode for goods
- D. Yet Another Minimization Problem
- NSI packaging script add file details
- Find all missing numbers in the array
- 12种数据量纲化处理方式
- Case study on comprehensive competitiveness of principal components
- 1、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》什么是NFT
- What if the reliability coefficient is low? How to calculate the reliability coefficient?
- 隐私沙盒终于要来了
猜你喜欢

用GSConv+Slim Neck改进Yolov5,将性能提升到极致!

Solution: you can ping others, but others can't ping me

After studying 11 kinds of real-time chat software, I found that they all have these functions

关于企业中台规划和 IT 架构微服务转型

Relational database management system of easyclick

Classpath classpath

Blue Bridge Cup real topic: the shortest circuit

A wonderful time to buy and sell stocks

Computer network interview assault

Privacy sandbox is finally coming
随机推荐
LeetCode-21合并两个有序链表
创建您自己的NFT集合并发布一个Web3应用程序来展示它们(介绍)
How to manage 1000 anchors by one person?
LeetCode 148. Sort linked list
Static timing analysis (STA) in ic/fpga design
R language uses the transmute function of dplyr package to calculate the moving window mean value of the specified data column in dataframe data, and uses ggplot2 package to visualize the line graph b
Weekly recommended short videos: be alert to the confusion between "phenomena" and "problems"
Principal component calculation weight
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
[today in history] February 15: Pascal's father was born; YouTube was founded; Kotlin language comes out
每周推荐短视频:警惕“现象”与“问题”相互混淆
解决方案:可以ping别人,但是别人不能ping我
540. Single element in ordered array / 1684 Count the number of consistent strings
GAMES202作业0-环境搭建过程&解决遇到的问题
信度系数低怎么办?信度系数具体怎么算?
Mise en place d'une plate - forme générale de surveillance et d'alarme, quelles sont les conceptions nécessaires dans l'architecture?
Financial judgment questions
Livedata postvalue will "lose" data
Xia CaoJun ffmpeg 4.3 audio and video foundation to engineering application
About enterprise middle office planning and it architecture microservice transformation