Sort the list [4, 2, 7, 1, 3, 7, 2] and find all duplicates by comparing adjacent elements
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Sort the list [4, 2, 7, 1, 3, 7, 2] and find all duplicates by comparing adjacent elements. Print the sorted list of duplicates.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.