Skip to content

Bug Report for remove-duplicates-from-sorted-array #4390

@Anshuraj70

Description

@Anshuraj70

Bug Report for https://neetcode.io/problems/remove-duplicates-from-sorted-array

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.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions