@@ -0,0 +1,1059 @@
+public class Solution %7B%0A    %0A    private List%3CList%3CInteger%3E%3E ret;%0A    public List%3CList%3CInteger%3E%3E permute(int%5B%5D nums) %7B%0A        ret = new ArrayList%3CList%3CInteger%3E%3E();%0A        int%5B%5D index = new int%5Bnums.length%5D;%0A        for(int i=0; i%3Cnums.length; i++) index%5Bi%5D = -1;%0A        Arrays.sort(nums);%0A        backtrack(nums, 0, index);%0A        return ret;%0A    %7D%0A    %0A    private void backtrack(int%5B%5D nums, int k, int%5B%5D index) %7B%0A        if(k == nums.length) %7B%0A            Integer%5B%5D xx = new Integer%5Bnums.length%5D;%0A            for(int i=0; i%3Cnums.length; i++) %7B%0A                xx%5Bindex%5Bi%5D%5D = nums%5Bi%5D;%0A            %7D%0A            ret.add(Arrays.asList(xx));%0A            return;%0A        %7D%0A        %0A        for(int i=0; i%3Cnums.length; i++) %7B%0A            // Make sure no duplicate permutation here after the check.%0A            // if(i%3E0 && nums%5Bi%5D == nums%5Bi-1%5D && index%5Bi-1%5D == -1) continue;%0A            %0A            if(index%5Bi%5D == -1) %7B%0A                index%5Bi%5D = k;%0A                backtrack(nums, k+1, index);%0A                index%5Bi%5D = -1;%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Create Permutations.java