https://leetcode.com/problems/remove-duplicates-from-sorted-array/
来源:互联网 发布:阿里云机顶盒刷机工具 编辑:程序博客网 时间:2024/06/05 12:00
https://leetcode.com/problems/remove-duplicates-from-sorted-array/
很简单 因为已经排好序 i 和i下一个值相等就把下一个复制为字符串 最后再排序取数字即可
<pre name="code" class="python">class Solution: # @param a list of integers # @return an integer def removeDuplicates(self, A): length=len(A) n=0 for i in range(length-1): if A[i]==A[i+1]: A[i]='a' n=n+1 A.sort() A=A[0:length-n] return length-n
0 0
- https://leetcode.com/problems/remove-duplicates-from-sorted-array/
- https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
- [leetcode][array] Remove Duplicates from Sorted Array
- 【Leetcode】【Array】Remove Duplicates from Sorted Array
- https://leetcode.com/problems/merge-sorted-array/
- LeetCode: Remove Duplicates from Sorted Array
- LeetCode: Remove Duplicates from Sorted Array II
- [Leetcode] Remove Duplicates from Sorted Array
- [Leetcode] Remove Duplicates from Sorted Array II
- LeetCode: Remove Duplicates from Sorted Array
- LeetCode: Remove Duplicates from Sorted Array II
- [Leetcode] Remove Duplicates from Sorted Array II
- leetcode 35: Remove Duplicates from Sorted Array
- [LeetCode] Remove Duplicates from Sorted Array II
- [LeetCode] Remove Duplicates from Sorted Array
- Leetcode: Remove Duplicates from Sorted Array
- [leetcode] Remove Duplicates from Sorted Array II
- [LeetCode]Remove Duplicates from Sorted Array
- 如何在.cs中统一动态修改xaml中style资源定义的样式
- 笔试面试题记录
- Ruby on Rails 之旅(七)—— Ruby on Rails 入门(4)
- poj1029 模拟
- sql server 查看死锁
- https://leetcode.com/problems/remove-duplicates-from-sorted-array/
- Merge Two Sorted Lists
- Java快速教程
- Ruby on Rails 之旅(七)—— Ruby on Rails 入门(2)
- Android中如何修改系统时间(应用程序获得系统权限)
- pycharm 教程(一)安装和首次使用
- 博客首文,纪念纪念!
- 该遗失的世界
- Linux编译安装GCC-5.1.0