解法一:用next_permutation()函数,要求第k个排列,就从"123...n"开始调用 k - 1 次 next_permutation()函数即可. class Solution { public: string getPermutation(int n, int k) { string res; for(int i = 1; i <= n; ++i) { res += to_string(i); } for(int i = 0; i < k - 1; ++i
Additive number is a positive integer whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the sequence must be the sum of the preceding