implement a stack that also soppurt finding the min in o(1) time.
Anonymous
hold two stacks, regular one and one that only keep the min for that time. when pop from the original stack, pop it also from the mn stack if it the same element.
Check out your Company Bowl for anonymous work chats.