Company: Decendro_19_jan
Difficulty: medium
Chess Tournament Problem Description A chess tournament has n players numbered 1 to n . Each player has a unique potential value, given by potential[i] for player i+1 . Players start in a queue in the order [1, 2, 3, ..., n] . The tournament proceeds as follows: The first two players in the queue compete. The player with the higher potential wins. The winner stays at the front of the queue. The loser moves to the back of the queue. If the same player at the front keeps winning, their consecutive win count increases. The tournament stops as soon as a player reaches k consecutive wins. Your task is to determine the potential value of the player who first achieves k consecutive wins. Return that value. Example Suppose n = 4 , participants have potentials potential = [3, 2, 1, 4] , and k = 2 . Output: 3 Explanation: Initial position of participants: The queue of potentials is initially [3, 2, 1, 4] . Participants 1 and 2 compete. Their potentials are 3 and 2. Player 1 wins due to the highe