Remove Duplicates
Medium
arrays
Description
Given a list of items, return a new list containing only the unique elements in their original order.
Examples
Example:
Input: [1, 2, 2, 3, 4, 3]
Output: [1, 2, 3, 4]
Explanation: The second '2' and second '3' are removed, keeping the order of the first appearance.
Constraints
- Input is a list of primitives (integers, strings).
- Output must be a list.
- The order of first appearance must be maintained.
Loading...
Test Case 1
Input: [1,2,2,3,4,3]
Output: [1,2,3,4]
Test Case 2
Input: ["a","b","a","c"]
Output: ["a","b","c"]
Test Case 3
Input: [5,5,5,5]
Output: [5]
