Question:
Given 3 integers n, m, k (n, m ≤ 10^4; k ≤ 10^9). Find the K'th position of nCm.
Example:
N = 7, M = 3, K = 6.
The first 6 7C3 permutations are:
- 1 2 3
- 1 2 4
- 1 2 5
- 1 2 6
- 1 2 7
- 1 3 4
So the answer would be 1 3 4
P/S: I only know how to solve this problem using brute force, which takes O(N*K). Is there any better solution for this problem?