comefrom: <awangdev>402. Remove K Digits_1.java
code: public String removeKdigits(String num, int k) {
          Stack<Character> stack = new Stack<>();
          
          int i = 0, n = num.length();
          while (i < n) {
              char c = num.charAt(i++);
              while (k > 0 && !stack.isEmpty() && stack.peek() > c) {
                  stack.pop();
                  k--;
              }
              stack.push(c);
          }
          
          while (k-- > 0) stack.pop();
          
          StringBuffer sb = new StringBuffer();
          while(!stack.isEmpty()) sb.append(stack.pop());
          sb.reverse();
          while(sb.length() > 0 && sb.charAt(0) == '0') sb.deleteCharAt(0);
          
          return sb.length() == 0 ? "0" : sb.toString();
      }
masked: public String var_0 ( String var_1 , int var_2 ) {
    Stack < Character > var_3 = new Stack < > ( ) ;
    int var_4 = 0 , var_5 = var_1 . length ( ) ;
    while ( var_4 < var_5 ) {
      char var_6 = var_1 . charAt ( var_4 ++ ) ;
      while ( var_2 > 0 && ! var_3 . isEmpty ( ) && var_3 . peek ( ) > var_6 ) {
        var_3 . pop ( ) ;
        var_2 -- ;
      }
      var_3 . push ( var_6 ) ;
    }
    while ( var_2 -- > 0 ) var_3 . pop ( ) ;
    StringBuffer var_7 = new StringBuffer ( ) ;
    while ( ! var_3 . isEmpty ( ) ) var_7 . append ( var_3 . pop ( ) ) ;
    var_7 . reverse ( ) ;
    while ( var_7 . length ( ) > 0 && var_7 . charAt ( 0 ) == '0' ) var_7 . deleteCharAt ( 0 ) ;
    return var_7 . length ( ) == 0 ? "0" : var_7 . toString ( ) ;
  }
  