https://leetcode.com/problems/remove-duplicates-from-sorted-array/#/description
class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if len(nums)<=1: return len(nums)
v = nums[0]
ret = 1
for ind in xrange(1,len(nums)):
if v!=nums[ind]:
v=nums[ind]
ret+=1
if ret!=ind+1 and ind+1<len(nums):
nums[ret]=nums[ind+1]
return ret