Description

An array arr is given. Each element of arr is a number between 0 through 9. You want to remove all the duplicate numbers in the array arr except for only one. However, the order of each element in the array arr should be maintained. For example,

  • When arr = [1, 1, 3, 3, 0, 1, 1], return [1, 3, 0, 1].
  • When arr = [4, 4, 4, 3, 3], return [4, 3].

Write a function solution to return the remaining numbers after removing the duplicate numbers in the array arr except only one.

Constraints
  • Length of array arr : natural number less than or equal to 1,000,000.
  • Element of array arr : integer between 0 and 9.

Examples
arr answer
[1,1,3,3,0,1,1] [1,3,0,1]
[4,4,4,3,3] [4,3]

Example #1,2
It is the same as the example in the problem statement.

Result Stop
Result of [Run] or [Submit] will be displayed here