Find the maximum value in a stack, with constant complexity
Anonymous
It's easy to keep track of the highest value when you do push. But it gets tricky when you do pop. You may need two stacks to keep track of it.
Check out your Company Bowl for anonymous work chats.