@@ -0,0 +1,715 @@
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class LeetCode0060 %7B%0A%09public String getPermutation(int n, int k) %7B%0A%09%09if (n %3C 0 %7C%7C k %3C 0) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09List%3CInteger%3E numList = new ArrayList%3CInteger%3E();%0A%09%09int fractorial = 1;%0A%09%09for (int i = 1; i %3C= n; i++) %7B%0A%09%09%09numList.add(i);%0A%09%09%09fractorial *= i;%0A%09%09%7D%0A%09%09k--;%0A%09%09StringBuilder sb = new StringBuilder();%0A%0A%09%09for (int i = 0; i %3C n; i++) %7B%0A%09%09%09fractorial /= n - i;%0A%09%09%09int index = k / fractorial;%0A%09%09%09sb.append(numList.get(index));%0A%09%09%09numList.remove(index);%0A%09%09%09k %25= fractorial;%0A%09%09%7D%0A%09%09return sb.toString();%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09LeetCode0060 leetcode = new LeetCode0060();%0A%09%09System.out.println(leetcode.getPermutation(3, 4));%0A%09%7D%0A%7D%0A

Add LeetCode0060.java