Viber interview question

implement stack with O(1) for finding the max element