Company: juspay_17oct
Difficulty: medium
Book Stacks Game Problem Description Two friends, Aria and Leo, are playing a game in a library. There are n stacks of books, and the i -th stack initially contains ai books. Aria always moves first. On each turn, a player chooses a non-empty stack and removes exactly one book from it. However, a player is not allowed to pick the same stack that was chosen in the immediately previous turn (either by the opponent, or if it's the first move, then any stack can be chosen). The player who cannot make a move on their turn loses. Assuming both players play optimally, determine the winner of each of the t games. Input The first line contains a single integer t ( 1 ) - the number of games. The description of each game follows. The first line contains a single integer n ( 1 ) - the number of stacks. The second line contains n integers a1, a2, ..., an ( 1 ). Output For each game, print "X" if Aria wins, otherwise "Y". Examples Example 1: Input: 1 2 1 6 Output: X Explanation: This example is from