blob: a77286bb5f943085547f71f9693b63ec5c1341d9 (
plain)
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
|
#include "leetcode.h"
#include <vector>
class Solution {
public:
vector<int> fact;
string getPermutation(int n, int k) { int n = k - 1; }
private:
void helper(int k) {
fact = vector<int>(k);
fact[0] = 1;
if (k == 1)
return;
fact[1] = 1;
for (int i = 2; i < k; i++)
fact[i] = i * fact[i - 1];
}
};
int main() {
Solution obj;
int n = 3, k = 3;
cout << obj.getPermutation(n, k);
}
|