当前位置:网站首页>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
边栏推荐
- 必看,时间序列分析
- Memo - about C # generating barcode
- Mysql database of easyclick
- (6) VIM editor MV cat redirection standard input and output more pipe symbols head tail
- 期货账户的资金安全吗?怎么开户?
- Privacy sandbox is finally coming
- Blue Bridge Cup real problem: word analysis
- A database editing gadget that can edit SQLite database. SQLite database replaces fields. SQL replaces all values of a field in the database
- Reading notes series "modern methods of C language programming" -- Chapter 2
- 每周推薦短視頻:警惕“現象”與“問題”相互混淆
猜你喜欢
Leetcode203 移除链表元素
About enterprise middle office planning and it architecture microservice transformation
A wonderful time to buy and sell stocks
解决方案:可以ping别人,但是别人不能ping我
Leetcode-141环形链表
Calculation of intersection of two line segments
创建您自己的NFT集合并发布一个Web3应用程序来展示它们(介绍)
Why do independent website sellers start to do social media marketing? The original customer conversion rate can be improved so much!
How does factor analysis calculate weights?
搭建一个通用监控告警平台,架构上需要有哪些设计
随机推荐
D. Yet Another Minimization Problem
Bernoulli distribution (a discrete distribution)
Rust language - cargo, crates io
R语言使用epiDisplay包的aggregate函数将数值变量基于因子变量拆分为不同的子集,计算每个子集的汇总统计信息
Case study on comprehensive competitiveness of principal components
Image acquisition and playback of coaxpress high speed camera based on pxie interface
Solution: you can ping others, but others can't ping me
Highly reliable program storage and startup control system based on anti fuse FPGA and QSPI flash
Basic concepts of binary tree
What if the reliability coefficient is low? How to calculate the reliability coefficient?
The ultimate version of the 13th simulation of the single chip microcomputer provincial competition of the Blue Bridge Cup
每周推薦短視頻:警惕“現象”與“問題”相互混淆
Leetcode-83 删除排序链表中重复的元素
Popular science: what does it mean to enter the kernel state?
Computer network interview assault
Livedata postvalue will "lose" data
LeetCode 148. Sort linked list
12种数据量纲化处理方式
解决方案:可以ping别人,但是别人不能ping我
因子分析怎么计算权重?