Combinations
Medium · Backtracking · about 15 minutes
Asked at Google, Amazon, Apple.
Given integers n and k, return all combinations of k distinct numbers chosen from 1..n. Each combination is listed in increasing order; the combinations may be in any order.