Assignment for CS đ„ș
You are holding a contest to determine the ultimate penny champion. Each participant in the contest has decided which side of the penny they like, heads or tails, and keeps that decision to themselves. We represent heads using the boolean value true and tails using false. The contest participants all get in a long line (array). They start by pairing up (the first two, second two, and so forth). After the two members reveal their pennies to each other, if both are the same, the first (left) person wins, otherwise, the second (right) person wins. The remaining members then battle it out the same way in the next round until only one winner emerges. If there are an odd number of people in any round, the last person gets a âbyeâ and automatically survives to the following round. Solve the problem recursively by writing the following method: public static int champion(boolean[] a) Return the index corresponding to the winner of the contest. You do not need to allocate any arrays for this problem