public String getPermutation(int n, int k) {
		boolean[] used = new boolean[n];
		int possible = 1, i = 1;
		while(i < n) {
			possible *= i;
			i++;
		}
		
		StringBuilder sb = new StringBuilder();
		k--;
		for(i = n - 1; i >= 0; i--) {
			int pos = k / possible;
			k -= pos * possible;
			if(i != 0) possible /= i;
			
			for(int j = 0; j < n; j++)
				if(!used[j]) {
					if(pos == 0) {
						sb.append(j+1);
						used[j] = true;
						break;
					}
					pos--;
				}
		}
		return sb.toString();
	}