51. 数字排列(含重复数字)

题目地址:https://www.acwing.com/problem/content/87/

AC代码

class Solution {
public:
    vector> res;
    vector path;

    bool canSwap(vector& v,int start ,int end){
        for(int i=start;i& v,int start,int len){
        if(start==len){
            res.push_back(path);
            return;
        }
        
        for(int i=start;i> permutation(vector& nums) {
        sort(nums.begin(),nums.end());
        f(nums,0,nums.size());
        return res;
    }
};

总结

题解参考讨论区

你可能感兴趣的:(51. 数字排列(含重复数字))