comefrom: <awangdev>Permutation Sequence_2.java
code: public String getPermutation(int n, int k) {
          if (n <= 0 || k <= 0) {
          	return "";
          }
          ArrayList<Integer> nums = new ArrayList<Integer>();
          for (int i = 1; i <= n; i++) {
          	nums.add(i);
          }
  
          int frontInd = 0;
          for (; frontInd < nums.size(); frontInd++) {
  	        int factorio = 1;
  	    	for (int i = 1; i < n; i++) {
  	    		factorio = factorio * i;
  	    	}
  	    	int startInd = frontInd;
  	    	int numPermute = factorio;
  	    	while (numPermute < k) {
  	    		numPermute += factorio;
  	    		startInd++;
  	    	}
  
  	    	if (startInd != frontInd) {
  	    		int temp = nums.get(startInd);
  	    		nums.remove(startInd);
  	    		nums.add(frontInd, temp);
  		  		k = k - numPermute;
  		  		n--;
  	        }
  	    }
  	    StringBuffer sb = new StringBuffer();
        	for (int num : nums) {
        		sb.append(num);
        	}
          return sb.toString();
      }
masked: public String var_0 ( int var_1 , int var_2 ) {
    if ( var_1 <= 0 || var_2 <= 0 ) {
      return "" ;
    }
    ArrayList < Integer > var_3 = new ArrayList < Integer > ( ) ;
    for ( int var_4 = 1 ;
    var_4 <= var_1 ;
    var_4 ++ ) {
      var_3 . add ( var_4 ) ;
    }
    int var_5 = 0 ;
    for ( ;
    var_5 < var_3 . size ( ) ;
    var_5 ++ ) {
      int var_6 = 1 ;
      for ( int var_4 = 1 ;
      var_4 < var_1 ;
      var_4 ++ ) {
        var_6 = var_6 * var_4 ;
      }
      int var_7 = var_5 ;
      int var_8 = var_6 ;
      while ( var_8 < var_2 ) {
        var_8 += var_6 ;
        var_7 ++ ;
      }
      if ( var_7 != var_5 ) {
        int var_9 = var_3 . get ( var_7 ) ;
        var_3 . remove ( var_7 ) ;
        var_3 . add ( var_5 , var_9 ) ;
        var_2 = var_2 - var_8 ;
        var_1 -- ;
      }
    }
    StringBuffer var_10 = new StringBuffer ( ) ;
    for ( int var_11 : var_3 ) {
      var_10 . append ( var_11 ) ;
    }
    return var_10 . toString ( ) ;
  }
  