leetcode 日经贴,python code -Remove Duplicates from Sorted Array
2015-02-17 13:24
435 查看
Remove Duplicates from Sorted Array
class Solution: # @param a list of integers # @return an integer def removeDuplicates(self, A): n = len(A) if n <= 1: return n m = 1 for i in range(1, n): if A[i] != A[m - 1]: A[m] = A[i] m += 1 return m
相关文章推荐
- LeetCode26 Remove Duplicates from Sorted Array(Python字典妙用)
- 26. Remove Duplicates from Sorted Array Leetcode Python
- LeetCode 26 — Remove Duplicates from Sorted Array(C++ Java Python)
- leetcode 26.Remove Duplicates from Sorted Array python
- LeetCode 26 Remove Duplicates from Sorted Array (C,C++,Java,Python)
- LeetCode 26. Remove Duplicates from Sorted Array——python(easy)
- [leetcode]Remove Duplicates from Sorted Array @ Python
- python写算法题:leetcode: 26. Remove Duplicates from Sorted Array
- 【LeetCode with Python】 Remove Duplicates from Sorted Array
- [leetcode] python Remove Duplicates from Sorted Array II
- leetcode Remove Duplicates from Sorted Array python
- [LeetCode]Remove Duplicates from Sorted Array II @python
- [LeetCode]题解(python):080-Remove Duplicates from Sorted Array II
- [Leetcode][python]Remove Duplicates from Sorted Array/Remove Duplicates from Sorted Array II
- [LeetCode]题解(python):026-Remove Duplicates from Sorted Array
- 【LeetCode with Python】 Remove Duplicates from Sorted Array II
- Leetcode-Remove Duplicates from Sorted Array-Python
- [LeetCode]Remove Duplicates from Sorted Array@python
- [leetcode] Remove Duplicates from Sorted Array python
- 【LEETCODE】80-Remove Duplicates from Sorted Array II [Python]