LeetCode 82 Remove Duplicates from Sorted List
来源:互联网 发布:apache启动和开始命令 编辑:程序博客网 时间:2024/06/07 03:32
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
public class Solution { public int removeDuplicates(int[] A) { if(A==null || A.length<1) return 0; int i=1; int elem=A[0]; for(int j=1; j<A.length; j++) { if(A[j]!=elem) { elem=A[j]; A[i++] = A[j]; } } return i; }}
0 0
- LeetCode 82 Remove Duplicates from Sorted List
- leetCode #82 Remove Duplicates from Sorted List
- Remove Duplicates from Sorted List :from LeetCode
- Leetcode - List - Remove Duplicates from Sorted List
- [leetcode][list] Remove Duplicates from Sorted List
- [leetcode][list] Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List II
- [Leetcode] Remove Duplicates from Sorted List
- [Leetcode] Remove Duplicates from Sorted List II
- LeetCode: Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List II
- [Leetcode] Remove Duplicates from Sorted List II
- leetcode 37: Remove Duplicates from Sorted List
- [leetcode] Remove Duplicates from Sorted List II
- [LeetCode] Remove Duplicates from Sorted List II
- [LeetCode] Remove Duplicates from Sorted List
- [leetcode] Remove Duplicates from Sorted List
- 0002/1000 你好上海
- 51单片机基础汇总
- C语言单链表实现19个功能完全详解
- Android收起虚拟键盘
- Java 问题集锦
- LeetCode 82 Remove Duplicates from Sorted List
- 第一次的见面礼
- ant 打包android应用
- 主成分分析原理
- Objective-C函数速查实例手册
- 妈妈去哪儿
- git
- ArcGIS教程:共享地理处理工作流快速浏览
- ADF与SSM框架之间的交互(未完待续)