Animal King Election
Time limit1sMemory limit512 MB
Read nine votes, each either Tiger or Lion, and print the candidate who received more than half of them.
- Level
Easy1 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Problem
King Dragon, the king of the Animal Kingdom, passed away this morning. Every animal was saddened by this unfortunate news. Since no one has seen any other living dragon these days, the government of the Animal Kingdom cannot find a successor to King Dragon. But the Animal Kingdom cannot operate without a king. The government of the Animal Kingdom decided to elect a new king.
There are nine voters: Armadillo, Buffalo, Cat, Dog, Elephant, Fox, Goat, Hippo, and Zebra, and two candidates: Tiger and Lion.
The votes will be cast anonymously tomorrow. The government asked you to write a program that counts the votes and announces the next king of the Animal Kingdom. The next king is the one who receives more than half the votes.
Input
The input has exactly nine lines. Each line is a string that is either Tiger or Lion, and it represents a vote cast by an anonymous voter.
Output
Output one line containing the next king's name.
Constraints
- Every string in the input is either
TigerorLion. - The next king must have at least five votes.