The Triple Alliance
A hard Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L4
Problem
In ledger reconciliation the same amount can land on many lines and some entries are credits, so the input list `nums` may hold duplicate and negative values. Given `nums` and a target `k`, return each trio of values taken from three distinct positions that sums to `k`, every trio ordered smallest value first and trios sharing the same three values collapsed to one. Return the trios ordered from the smallest value-list to the largest.
Summary
Three numbers, one target.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.