Remove Duplicates Using Set
Medium📝 Description
Remove duplicates from a list using a set.
Input Format
[1, 2, 2, 3, 4, 4, 5]
Output Format
[1, 2, 3, 4, 5]
Constraints
List length ≤ 10^5
🔍 Sample Input
[1, 2, 2, 3, 4, 4, 5]
✅ Sample Output
[1, 2, 3, 4, 5]
Code Editor
Please login to run and submit code.
Results
Suggested Solution
Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run