public String getPermutation(int n, int k) {
        String result = "";
        int[] nF = new int[n+1];
        if(n!=0){nF = this.getFactoria(n);}
        if(n>9 || n<1 || k<1 || k>nF[n]){return result;}
        
        ArrayList<Character> nNum = new ArrayList<Character>();
        for(int i=1;i<=n;i++){
            nNum.add((char)('0'+i));
        }
        
        int rem = 0;
        int div = k-1;
        int now = n-1;
        char[] temp = new char[n];
        int charPos = 0;
        while(nNum.size()!=0){
            rem = div%nF[n-charPos-1];              
            div = div/nF[n-charPos-1];
            temp[charPos] = nNum.get(div);
            nNum.remove(div);
            div = rem;
            charPos++;
        }
        return new String(temp);
    }