楼主: 
sixB (6B)   
2024-10-05 10:14:5760.
又写一题permutation
虽然概念完全不一样就是了==
排列组合
找n! 里的第k个
一位一位找 看是要第几个
然后就下面一位
阿信都会
class Solution {
public:
    string getPermutation(int n, int k) {
        vector<int> s(n+1, 1);
        int total = 1;
        for(int i = 1; i <= n; i++){
            total *= i;
        }
        string res;
        while(n > 0){
            int div = total / n;
            int pos = (k-1)/div + 1;
            int idx = 1;
            for(int i = pos; i > 1; idx++){
                if(s[idx] > 0){
                    i