src/main/java/com/leetcode/design/easy/ImplementQueueUsingStacks_232.java
public void push(int x) {
      while (!stack.isEmpty()) {
        backup.push(stack.pop());
      }
      backup.push(x);
      while (!backup.isEmpty()) {
        stack.push(backup.pop());
      }
    }
/** Push element x to the back of queue. */
Push element x to the back of queue.
Push element x to the back of queue .
public void push(int x) {
      while (!stack.isEmpty()) {
        backup.push(stack.pop());
      }
      backup.push(x);
      while (!backup.isEmpty()) {
        stack.push(backup.pop());
      }
    }
public void push ( int x ) { while ( ! stack . isEmpty ( ) ) { backup . push ( stack . pop ( ) ) ; } backup . push ( x ) ; while ( ! backup . isEmpty ( ) ) { stack . push ( backup . pop ( ) ) ; } }
Push element x to the back of queue.
Push element x to the back of queue .