Unbxd interview question

Next greater element in array in o(n)