Big Data vs Information Security vs AI
Time limit1sMemory limit512 MB
Given a string of B, S, and A answers, output the most frequent letter, listing tied letters in B, S, A order or SCU if all three tie.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
The Big Data Information Security department at Seoul Cyber University has a mix of students interested in big data and students interested in information security. For the 2024 academic year, the university created a new Department of Artificial Intelligence.
Professor Noh and Professor Chun were designing the curricula of the Big Data Information Security and Artificial Intelligence departments together. They wondered which field students care about most: big data, information security, or artificial intelligence. So each time they met a student, they asked and recorded the answer in a notepad as B, S, or A. (B means big data, S means information security, and A means artificial intelligence.)
The notes are hard to read at a glance, so it is difficult to tell which field draws the most interest. They asked you to analyze the records. Given the number of students asked and their answers, output the result.
Input
The first line contains the number of students asked, .
The second line contains the answers from the notepad as a single string. The string consists only of B, S, and A.
Output
On the first line, output the letter of the field that the most students chose. If two fields are tied for the most students, output all of them in the order B, S, A, with commas between them. If all three fields are tied, output SCU. (SCU is short for Seoul Cyber University.)