IndiGo interview question

Q: Next greater element in the array (LeetCode Medium)