Pergunta de entrevista da empresa Indeed

How to find the minimum value in a stack with constant time complexity?

Resposta da entrevista

Sigiloso

17 de set. de 2015

Keep track of the minimum value in a second stack/variable when you push. This way minimum value is always at hand.