The Triplet Hunt
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L5
Problem
Given a list of integers and target k, return all unique triplets (a, b, c) with a <= b <= c whose sum equals k. Each triplet is a 3-element list. Return the list of triplets sorted lexicographically, with no duplicate triplets.
Summary
Every path that works gets a seat at the table.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.