Given two integers n and k, return all possible combinations of size k containing distinct numbers between 1 and n.
Note: The list should not contain any duplicate combinations.
n: 4
k: 2
Combinations: [
[1, 2],
[1, 3],
[1, 4],
[2, 3],
[2, 4],
[3, 4]
]
The first line contains an integer ‘T’, denoting the number of test cases.
For each test case, the input has two integers n and k.
For each test case, the output has the following lines:
3
4 2
3 3
4 1
6
1 2
1 3
1 4
2 3
2 4
3 4
1
1 2 3
4
1
2
3
4
1 <= T <= 10
1 <= k <= n <= 20