Stratoscale interview question

implement a stack that also soppurt finding the min in o(1) time.

Interview Answer

Anonymous

23 Jul 2018

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.