Given a circular integer array nums, return for each element the next greater element scanning forward (wrapping around); use -1 if none exists.
Input: one line of space-separated integers. Output: the result array, space-separated.
1 2 1
2 -1 2
The last 1 wraps around to find 2.
1 2 3 4 3
2 3 4 -1 4
Run your code against the sample tests, or Submit to run the full suite.