83. Remove Duplicates from Sorted List
来源:互联网 发布:世界历史地图软件 编辑:程序博客网 时间:2024/05/22 14:09
这道题很简单属于一遍ac题,放两个指针,一个在前,一个在后,只要他们俩值不同,就连起来,不管中间有什么。。。
public class Solution { public ListNode deleteDuplicates(ListNode head) { if(head==null)return head; if(head.next==null)return head; ListNode first = head; ListNode second = head.next; while(second!=null){ if(first.val==second.val){ second = second.next; }else{ first.next = second; first = second; second = first.next; } } first.next = second; return head; }}
0 0
- [LeetCode]83.Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- [Leetcode] 83. Remove Duplicates from Sorted List
- LeetCode --- 83. Remove Duplicates from Sorted List
- [leetcode] 83.Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- LeetCode 83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- 【leetcode】83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List LeetCode
- 83. Remove Duplicates from Sorted List
- leetcode 83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- [LeetCode]83. Remove Duplicates from Sorted List
- 【LeetCode】83. Remove Duplicates from Sorted List
- LeetCode 83. Remove Duplicates from Sorted List
- 利用位移运算,做出按地区展示功能。
- 完整的申请邓白氏编码的流程
- GetWindowRect GetClientRect
- 安卓返回键监听:退出程序
- bootstrap 模态框的展示
- 83. Remove Duplicates from Sorted List
- 10.2创建sde服务不能启动问题
- 某政府单位应用交付解决方案系列一
- Java基础 - 线性表基本概念
- Android系统中设置TextView的行间距(非行高)
- ZBrush中的动态网格该怎么进行运用
- 1366 (HY000): Incorrect string value
- 仿QQ空间查看好友动态,ListView嵌套GridView显示接口中的图片
- js有关元素内容操作小结