@@ -0,0 +1,1490 @@
+public class Solution %7B%0A    public String getPermutation(int n, int k) %7B%0A        int%5B%5D nums = new int%5Bn%5D;%0A        for(int i=0; i%3Cn; i++) nums%5Bi%5D = i+1;%0A        for(int i=1; i%3Ck; i++) %7B%0A            nextPermutation(nums);%0A        %7D%0A        String s = %22%22;%0A        for(int i=0; i%3Cn ;i++)%0A        s += nums%5Bi%5D;%0A        return s;%0A    %7D%0A    %0A    public void nextPermutation(int%5B%5D array) %7B%0A        int i, j;%0A        // Find the largest index k such that a%5Bk%5D %3C a%5Bk + 1%5D. If no such index%0A        // exists, the permutation is the last permutation.%0A        for (i = array.length - 2; i %3E= 0; i--) %7B%0A            if (array%5Bi%5D %3C array%5Bi + 1%5D)%0A                break;%0A        %7D%0A        if (i %3C 0) %7B%0A            // System.out.println(%22End%22);%0A            Arrays.sort(array);%0A            return;%0A        %7D%0A        %0A        // Find the largest index l such that a%5Bk%5D %3C a%5Bl%5D. Since k + 1 is such%0A        // an index, l is well defined and satisfies k %3C l.%0A        for (j = array.length - 1; j %3E i; j--) %7B%0A            if (array%5Bj%5D %3E array%5Bi%5D)%0A                break;%0A        %7D%0A        %0A        // Swap a%5Bk%5D with a%5Bl%5D.%0A        swap(array, i++, j);%0A        %0A        // Reverse the sequence from a%5Bk + 1%5D up to and including the final%0A        // element a%5Bn%5D.%0A        for (j = array.length - 1; j %3E i; i++, j--) %7B%0A            swap(array, i, j);%0A        %7D%0A    %7D%0A    %0A    public void swap(int%5B%5D array, int x, int y) %7B%0A        array%5Bx%5D %5E= array%5By%5D;%0A        array%5By%5D %5E= array%5Bx%5D;%0A        array%5Bx%5D %5E= array%5By%5D;%0A    %7D%0A%7D%0A

Create Permutation_Sequence.java