@@ -0,0 +1,915 @@
+public class Solution %7B%0A    public List%3CList%3CInteger%3E%3E permute(int%5B%5D nums) %7B%0A        List%3CList%3CInteger%3E%3E res = new ArrayList%3C%3E();%0A        if (nums == null) %7B%0A            return res;%0A        %7D%0A        if (nums.length == 0) %7B%0A            res.add(new ArrayList%3CInteger%3E());%0A            return res;%0A        %7D%0A        List%3CInteger%3E tempList = new ArrayList%3C%3E();%0A        search(nums, res, tempList);%0A        return res;%0A    %7D%0A    %0A    private void search(int%5B%5D nums, List%3CList%3CInteger%3E%3E res, List%3CInteger%3E tempList) %7B%0A        if (tempList.size() == nums.length) %7B%0A            res.add(new ArrayList%3CInteger%3E(tempList)); // pay attention%0A            return;%0A        %7D%0A        %0A        for (int i : nums) %7B%0A            if (tempList.contains(i)) %7B%0A                continue;%0A            %7D%0A            tempList.add(i);%0A            search(nums, res, tempList);%0A            tempList.remove(tempList.size() - 1);%0A        %7D%0A    %7D%0A%7D

46. Permutations