Remove Duplicates from Sorted List II
来源:互联网 发布:外网端口查询 编辑:程序博客网 时间:2024/06/10 08:28
public ListNode deleteDuplicates(ListNode head) { // Start typing your Java solution below // DO NOT write main() function if(head == null) return head; ListNode dummy = new ListNode(0); dummy.next = head; ListNode previous = dummy; ListNode current = head; while(current != null) { int tmp = current.val; if(current.next != null && current.next.val == tmp) { while(current != null && current.val == tmp) { current = current.next; previous.next = current; } }else { previous = current; current = current.next; } } return dummy.next; }
- LeetCode: Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List II
- [Leetcode] Remove Duplicates from Sorted List II
- LeetCode: Remove Duplicates from Sorted List II
- [Leetcode] Remove Duplicates from Sorted List II
- [leetcode] Remove Duplicates from Sorted List II
- [LeetCode] Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List II
- [leetcode] Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List II
- Remove duplicates from sorted list II
- Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List II
- [LeetCode]Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List II
- [leetcode]Remove Duplicates from Sorted List II
- TCP/IP详解学习笔记(2)-数据链路层
- BIND9私有DNS服务器小环境搭建实验
- web集群时session同步的几种方法(统计)
- jframe将程序图标写到任务栏中
- xcode运行到真机报错 While reading xx/BackgroundHomeScreen_5.png pngcrush caught libpng error:
- Remove Duplicates from Sorted List II
- bootstrap取样
- TCP/IP详解之IP协议ARP协议和RARP协议
- s3c6410系统时钟
- poi excel 多级联动
- Android中dip,dp,sp,px的区别
- java拖动画矩形并截图
- java.util.List学习
- 广州传智播客JAVA就业班热热闹闹开班啦~