#K75212. Coin Flip Game
Coin Flip Game
Coin Flip Game
You are given n coins laid out in a row, where n satisfies \(1 \le n \le 100\). Each coin has two sides represented by a character: H
for heads and T
for tails. Alice and Bob play a game based on the initial configuration of the coins. The rules are as follows:
- If there is at least one coin showing heads (i.e. the character
H
appears in the input), then Alice wins. - If all the coins show tails, then Bob wins.
Your task is to determine the winner of the game given the number of coins and their initial states.
inputFormat
The input is given via standard input (stdin) and consists of two lines:
- The first line contains an integer \(n\), the number of coins.
- The second line contains a string of length \(n\) composed only of the characters
H
andT
representing the coin states.
outputFormat
Output the winner's name (Alice
or Bob
) to the standard output (stdout) based on the coin configuration.
3
TTT
Bob