Krishify interview question

Next Greater Element using stack