Engaged Employer
How to find the minimum value in a stack with constant time complexity?
Anonymous
Keep track of the minimum value in a second stack/variable when you push. This way minimum value is always at hand.
Check out your Company Bowl for anonymous work chats.