private void permute2Rec(int level, List<Integer> num, List<List<Integer>> res){
        if (level == num.size()) res.add(new ArrayList<Integer>(num));

        for (int i = level; i < num.size(); ++i){
            Collections.swap(num, i, level);
            permute2Rec(level + 1, num, res);
            Collections.swap(num, i, level);
        }
    }