Quite a problem
Time limit2sMemory limit256 MB
Print yes for each input line that contains problem in any capitalization, even inside longer words, and no otherwise.
- Level
Easy1 of 10
- Topics
- String matching, String
- Solved
- No attempts yet
Problem
It gets tiring, looking for all the ways the word problem can be used, and mis-used, in the news media. And yet that has been your job for several years: reading through news stories line by line, looking for that word. Automating the process would be much better.
Input
Each line of input is one test case. A line is at most 80 characters long, and there are at most 1000 lines. Input ends at end of file. A blank line still counts as a line.
Output
For each line of input, print yes if the line contains problem, and no otherwise. Capitalization is ignored, so any capitalization of the word counts as an occurrence. An occurrence inside a longer word, such as problematic or problems, counts as well.