Editorial for COCI '13 Contest 1 #1 Trener


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

We need to count which letters of the alphabet appear in input at least 5 times as the first letter of a surname. This can be accomplished using an array of size 26 and counting the number of occurrences of each first letter while reading the input. After that, it is sufficient to iterate over that array once and output the letters with a count of at least 5. It is also necessary to keep track whether any letter satisfied the condition and output PREDAJA if this was not the case.


Comments

There are no comments at the moment.