Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Remove Array Duplicates
00:00
5 left

Remove Array Duplicates

EasyPython

Problem

Implement a function to detect and remove duplicates from an array while preserving the original order.

Use the function signature def remove_duplicates(nums):. Return a new array containing the first occurrence of each value. The input contains integers, and the original array must not be modified.

Constraints

  • 0 <= len(nums) <= 1000
  • -10^9 <= nums[i] <= 10^9
  • The input array must not be modified

Function Signature

def remove_duplicates(nums):
Interviewer

Your question is Remove Array Duplicates. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.