comefrom: <awangdev>Remove Duplicate Letters_1.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]++;
          }
  
          StringBuffer sb = new StringBuffer("0");
          for (char c : arr) {
              count[c]--;
              if (visited[c]) {
                  continue;
              }
              char lastChar = sb.charAt(sb.length() - 1);
              while (c < lastChar && count[lastChar] > 0) {
                  sb.deleteCharAt(sb.length() - 1);
                  visited[lastChar] = false;
                  lastChar = sb.charAt(sb.length() - 1);
              }
              sb.append((char)(c));
              visited[c] = true;
          }
  
          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 ] ++ ;
    }
    StringBuffer var_6 = new StringBuffer ( "0" ) ;
    for ( char var_5 : var_2 ) {
      var_3 [ var_5 ] -- ;
      if ( var_4 [ var_5 ] ) {
        continue ;
      }
      char var_7 = var_6 . charAt ( var_6 . length ( ) - 1 ) ;
      while ( var_5 < var_7 && var_3 [ var_7 ] > 0 ) {
        var_6 . deleteCharAt ( var_6 . length ( ) - 1 ) ;
        var_4 [ var_7 ] = false ;
        var_7 = var_6 . charAt ( var_6 . length ( ) - 1 ) ;
      }
      var_6 . append ( ( char ) ( var_5 ) ) ;
      var_4 [ var_5 ] = true ;
    }
    return var_6 . substring ( 1 ) . toString ( ) ;
  }
  