below is my code segment for the problem. The question emphasized that only the new length will be important, but the test cases seemed to test the new array, making my code not acceptable. Any idea?
'''
class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
count = 0
for i in range(len(nums)1):
if nums[i] == nums[i+1]:
count+=1
return len(nums)count
'''
What do the test cases test ? ?


@yunchuankong said in What do the test cases test ? ?:
below is my code segment for the problem. The question emphasized that only the new length will be important, but the test cases seemed to test the new array, making my code not acceptable. Any idea?
'''
class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
count = 0
for i in range(len(nums)1):
if nums[i] == nums[i+1]:
count+=1
return len(nums)count
'''This is python code.