478. Football Team on a Circular Path
A football team is positioned on a circular path, with each player assigned a jersey number. It is possible for multiple players to have the same jersey number. The team plays a game where each player must find the next player with a greater jersey number. If there is no player with a greater jersey number, the player will return -1.
The first line of input contains the number of players, N. The second line contains the jersey numbers of the players.
An array representing the next greater elements
3 1 2 1
2 -1 2
- 1 <= nums.length <= 10^4 - 10^9 <= nums[i] <= 10^9