Remove Duplicates (Keep Order)
Easy 20 XPArraysHashing
Commonly asked at Zoho, Infosys
Read a list of integers and print them with duplicates removed, keeping the first occurrence of each value in its original order.
- Input
- One line of space-separated integers.
- Output
- The unique values, space-separated.
Sample 1
Input
4 5 4 1 5 2
Output
4 5 1 2
Read input with input() (no prompt message) and print only the answer. Run tries the Input box; Submit checks all test cases.
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.The solution unlocks after 3 submissions.