You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
My code for the problem Remove Duplicates From Sorted Array is not getting accepted.
Code: class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
temp = []
for a in nums:
if not a in temp:
temp.append(a)
return len(temp)
The output which it says is coming is [1,1,2,3]. How is it possible ? the output should be the length of temp array.