There are skills of size skills[i] represents the skill level of player i. All elements in skills are distinct. You are also given an integer k.
The competition proceeds in consecutive rounds as follows:
The first two players at the front of the queue play a match against each other.
The player with the strictly greater skill level wins the match.
The winner remains at the front of the queue, while the loser moves to the very back of the queue.
The competition ends as soon as any player achieves
Return the initial index of the player who wins
Constraints:
n skills.length
skills[i]
All integers in skills are unique.
There are skills of size skills[i] represents the skill level of player i. All elements in skills are distinct. You are also given an integer k.
The competition proceeds in consecutive rounds as follows:
The first two players at the front of the queue play a match against each other.
The player with the strictly greater skill level wins the match.
The winner remains at the front of the queue, while the loser moves to the very back of the queue.
The competition ends as soon as any player achieves
Return the initial index of the player who wins
Constraints:
n skills.length
skills[i]
All integers in skills are unique.