Pergunta de entrevista da empresa Fiverr Inc.

design a minimum stack that supports push, pop and getMinimum in o(1) time.

Resposta da entrevista

Sigiloso

28 de set. de 2017

add a second stack that keeps pointers to the minimum value in the first stack. both stacks are pushed and popped together.