LCC/Moose '20 Contest 5 J1 - Tracy the Chat Filter

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Tracy has been assigned the role of being a manual chat filter. She needs to detect strings with too many capital letter words. If strictly more than half of the words in the string are composed completely of capital letters, the string needs to be removed. Given a string of length N, composed of upper and lower case alphabetical characters and spaces separating the words, can you output if the string needs to be removed or not?

Input Specification

The first line will contain a single integer N (1 \leq N \leq 10^5), the length of Tracy's string.

The next line will contain a single string S, |S| = N, composed of upper and lowercase alphabetical characters and spaces. Each word in the string is guaranteed to contain at least one character.

Output Specification

Output yes if Tracy should remove the string, or no otherwise.

Sample Input 1

11
hi hi HI HI

Sample Output 1

no

Sample Input 2

39
FJHGDBN G G FD D S e e e e eeeeeeEEEEEE

Sample Output 2

yes

Comments

There are no comments at the moment.