Pergunta de entrevista da empresa HashedIn by Deloitte

Implement a stack which keeps pops the max element in constant time.