comefrom: <awangdev>844. Backspace String Compare_2.java
code: private String build(String s) {
  
          Stack<Character> stack = new Stack<>();
          for (char c : s.toCharArray()) {
              if (c != '#') stack.push(c);
              else if (!stack.isEmpty()) stack.pop();
          }
          StringBuffer sb = new StringBuffer();
          while (!stack.isEmpty()) sb.insert(0, stack.pop());
          return sb.toString();
      }
masked: private String var_0 ( String var_1 ) {
    Stack < Character > var_2 = new Stack < > ( ) ;
    for ( char var_3 : var_1 . toCharArray ( ) ) {
      if ( var_3 != '#' ) var_2 . push ( var_3 ) ;
      else if ( ! var_2 . isEmpty ( ) ) var_2 . pop ( ) ;
    }
    StringBuffer var_4 = new StringBuffer ( ) ;
    while ( ! var_2 . isEmpty ( ) ) var_4 . insert ( 0 , var_2 . pop ( ) ) ;
    return var_4 . toString ( ) ;
  }
  