Return every way to choose k numbers from 1, 2, ..., n, each written in increasing order, listed in dictionary order. For n = 4 and k = 2: [1,2], [1,3], [1,4], [2,3], [2,4], [3,4].
Example 1
Input:
all_combinations(4, 2)
Output:
[[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]
Example 2
Input:
all_combinations(1, 1)
Output:
[[1]]
1 <= n <= 200 <= k <= nC(n, k) lists; the tests keep it under 200,000.No results yet
Run your code to check it against the examples, or submit to run every test.