Amazon interview question

Next Greater Element Using Stacks