Amazon Interview Question

Write a program to achieve O(1) complexity for the max of the stack.