Given two integers n and k, return all possible combinations of k numbers out of 1 … n.
Example,
If n = 4 and k = 2, a solution is:
1 2 3 4 5 6 7 8 |
|
Solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Given two integers n and k, return all possible combinations of k numbers out of 1 … n.
If n = 4 and k = 2, a solution is:
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|