leetcode/src/main/java/com/my/MyQueue.java
/** Removes the element from in front of queue and returns that element. */
Removes the element from in front of queue and returns that element.
Removes the element from in front of queue and returns that element .
public int pop() {
        while (!realStack.isEmpty()){
            tempStack.push(realStack.pop());
        }
        int result = tempStack.pop();
        while (!tempStack.isEmpty()){
            realStack.push(tempStack.pop());
        }
        return result;
    }
public int pop ( ) { while ( ! realStack . isEmpty ( ) ) { tempStack . push ( realStack . pop ( ) ) ; } int result = tempStack . pop ( ) ; while ( ! tempStack . isEmpty ( ) ) { realStack . push ( tempStack . pop ( ) ) ; } return result ; }
Removes the element from in front of queue and returns that element.
Removes the element from in front of queue and returns that element .