comefrom: <awangdev>Remove Duplicate Letters_2.java
code: String removeDuplicateLetters(String s) {
          if (s == null || s.length() <= 1) {
              return s;
          }
          char[] arr = s.toCharArray();
          int[] count = new int[256];
          boolean[] visited = new boolean[256];
          for (char c : arr) {
              count[c]++;
          }
  
          Stack<Character> stack = new Stack<>();
          stack.push('0');
          for (char c : arr) {
              count[c]--;
              if (visited[c]) {
                  continue;
              }
              while (c < stack.peek() && count[stack.peek()] > 0) {
                  visited[stack.pop()] = false;
              }
              stack.push(c);
              visited[c] = true;
          }
  
          StringBuffer sb = new StringBuffer();
          while (!stack.isEmpty()) {
              sb.insert(0, stack.pop());
          }
          return sb.substring(1).toString();
      }
masked: String var_0 ( String var_1 ) {
    if ( var_1 == null || var_1 . length ( ) <= 1 ) {
      return var_1 ;
    }
    char [ ] var_2 = var_1 . toCharArray ( ) ;
    int [ ] var_3 = new int [ 256 ] ;
    boolean [ ] var_4 = new boolean [ 256 ] ;
    for ( char var_5 : var_2 ) {
      var_3 [ var_5 ] ++ ;
    }
    Stack < Character > var_6 = new Stack < > ( ) ;
    var_6 . push ( '0' ) ;
    for ( char var_5 : var_2 ) {
      var_3 [ var_5 ] -- ;
      if ( var_4 [ var_5 ] ) {
        continue ;
      }
      while ( var_5 < var_6 . peek ( ) && var_3 [ var_6 . peek ( ) ] > 0 ) {
        var_4 [ var_6 . pop ( ) ] = false ;
      }
      var_6 . push ( var_5 ) ;
      var_4 [ var_5 ] = true ;
    }
    StringBuffer var_7 = new StringBuffer ( ) ;
    while ( ! var_6 . isEmpty ( ) ) {
      var_7 . insert ( 0 , var_6 . pop ( ) ) ;
    }
    return var_7 . substring ( 1 ) . toString ( ) ;
  }
  