@@ -0,0 +1,790 @@
+public class Solution %7B%0A    public List%3CList%3CInteger%3E%3E permute(int%5B%5D nums) %7B%0A        List%3CList%3CInteger%3E%3E result = new ArrayList%3C%3E();%0A        permuteIter(0, result, nums);%0A        return result;%0A    %7D%0A%0A    private void permuteIter(int start, List%3CList%3CInteger%3E%3E result, int%5B%5D nums) %7B%0A        if (start == nums.length-1) %7B%0A            result.add(Arrays.stream(nums).boxed().collect(Collectors.toList()));%0A            return;%0A        %7D%0A        for (int target=start; target %3C nums.length; target++) %7B%0A            swap(nums, start, target);%0A            permuteIter(start+1, result, nums);%0A            swap(nums, start, target);%0A        %7D%0A    %7D%0A%0A    private void swap(int%5B%5D nums, int from, int to) %7B%0A        int temp = nums%5Bto%5D;%0A        nums%5Bto%5D = nums%5Bfrom%5D;%0A        nums%5Bfrom%5D = temp;%0A    %7D%0A%7D%0A

49. Permutations