comefrom: <qiyuangong>946_Validate_Stack_Sequences_1.java
code: public boolean validateStackSequences(int[] pushed, int[] popped) {
          Stack<Integer> inStack = new Stack<>();
          int posPush = 0, posPop = 0;
          while (posPush != pushed.length) {
              int curr = pushed[posPush];
              while (!inStack.empty() && popped.length > 0 && inStack.peek() == popped[posPop]) {
                  inStack.pop();
                  posPop++;
              }
              if (popped.length == 0) break;
              if (curr == popped[posPop]) posPop++;
              else inStack.push(curr);
              posPush++;
          }
          while (!inStack.empty() && popped.length > 0 && inStack.peek() == popped[posPop]) {
              inStack.pop();
              posPop++;
          }
          if (inStack.empty()) return true;
          return false;
      }
masked: public boolean var_0 ( int [ ] var_1 , int [ ] var_2 ) {
    Stack < Integer > var_3 = new Stack < > ( ) ;
    int var_4 = 0 , var_5 = 0 ;
    while ( var_4 != var_1 . length ) {
      int var_6 = var_1 [ var_4 ] ;
      while ( ! var_3 . empty ( ) && var_2 . length > 0 && var_3 . peek ( ) == var_2 [ var_5 ] ) {
        var_3 . pop ( ) ;
        var_5 ++ ;
      }
      if ( var_2 . length == 0 ) break ;
      if ( var_6 == var_2 [ var_5 ] ) var_5 ++ ;
      else var_3 . push ( var_6 ) ;
      var_4 ++ ;
    }
    while ( ! var_3 . empty ( ) && var_2 . length > 0 && var_3 . peek ( ) == var_2 [ var_5 ] ) {
      var_3 . pop ( ) ;
      var_5 ++ ;
    }
    if ( var_3 . empty ( ) ) return true ;
    return false ;
  }
  