eBay interview question

implement a stack that can return on o(1) the max value of the stack

Interview Answer

Anonymous

28 July 2017

user another stack push the new element to the stack push the max between the two top of the stacks to the other stacks.