โ† All coding problems

Remove duplicates, keep order

MediumArrays

Return a new list with the duplicates removed from nums, keeping the first occurrence of each number in its original order.

Function
function solve(nums)
Example 1
nums = [3,1,3,2,1]
โ†’ [3,1,2]

Submit also runs 3 hidden tests, including edge cases.

console.log output is shown below