当前位置:网站首页>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
边栏推荐
- Mysql database design
- [noip2015] jumping stone
- Livedata postvalue will "lose" data
- [acnoi2022] color ball
- Popular science: what does it mean to enter the kernel state?
- R语言ggplot2可视化:gganimate创建动态柱状图动画(gif)、在动画中沿给定维度逐步显示柱状图、enter_grow函数和enter_fade函数控制运动内插退出(渐变tweening)
- What impact will multinational encryption regulation bring to the market in 2022
- Leetcode-83 删除排序链表中重复的元素
- Rust language - cargo, crates io
- 主成分之综合竞争力案例分析
猜你喜欢

Localization through custom services in the shuttle application

Image acquisition and playback of coaxpress high speed camera based on pxie interface

Lumiprobe Lumizol RNA 提取试剂解决方案

2、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》启动并运行您的本地环境

Memo - about C # generating barcode

Database - MySQL advanced SQL statement (I)

实现一个Prometheus exporter

Why do independent website sellers start to do social media marketing? The original customer conversion rate can be improved so much!

Privacy sandbox is finally coming

12. Design of power divider for ads usage record
随机推荐
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用n.of.lines参数指定显示的病例数
Memo - about C # generating barcode for goods
Case study on comprehensive competitiveness of principal components
How to change guns for 2D characters
Salesmartly has some tricks for Facebook chat!
12. Design of power divider for ads usage record
GAMES202作业0-环境搭建过程&解决遇到的问题
Roll out! Enlightenment!
Vue uses keep alive to cache page optimization projects
How to manage 1000 anchors by one person?
Weekly recommended short videos: be alert to the confusion between "phenomena" and "problems"
力扣每日一题-第32天-1232. 缀点成线
Data query language (DQL)
Qt中的QFile读写文件操作
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
The 13th simulation problem of the single chip microcomputer provincial competition of the Blue Bridge Cup
Write it down once Net travel management background CPU Explosion Analysis
关于企业中台规划和 IT 架构微服务转型
Implement a Prometheus exporter
Is it safe to open a securities account? Is there any danger