Amazon Interview Question

Next Greater Element Using Stacks