871. Football Team on a Circular Path
The football team was standing on a circular path and each player is having a jersey number. Players can have same jersey number. The Team played a game where each player returns the next greater jersey number. If there is no next greater Jersey number exist then it will return -1.
First line contains number of players N. Second line contains jersey numbers.
An array representing next greater elements
3 1 2 1
2 -1 2
- 1 <= nums.length <= 10^4 - 10^9 <= nums[i] <= 10^9