You are given a 0-indexed array of non-negative integers nums. For each element nums[i], determine its second greater element and return an array res where res[i] contains the second greater element of nums[i].
The second greater element of nums[i] is defined as the value nums[j] such that:
If no such index j exists, then the second greater element for nums[i] is -1.
Constraints: