class Solution: # @param a list of integers # @return an integer def removeDuplicates(self, A): if not A: return 0 fast=slow=0 n=len(A) while fast<n: if A[slow]!=A[fast]: slow+=1 A[slow]=A[fast] fast+=1 return slow+1
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment