Viber Interview Question

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