The Perfect Match
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given a list of integers and an integer target, find all unique pairs whose elements sum to the target. Each pair is a 2-element list [a, b] with a <= b. Return the list of pairs sorted lexicographically (by a, then b). Each pair appears at most once even if multiple instances exist in the input.
Summary
Two numbers walk into an interview...
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.