public List<List<Integer>> permute2(int [] num){
        List<Integer> numList = new ArrayList<Integer>(num.length);
        for (int i : num) numList.add(i);

        List<List<Integer>> res = new ArrayList<List<Integer>>();
        permute2Rec(0, numList, res);
        return res;
    }