This page is still under construction.

Parts of this page are still being built. What you see may change.

Quite a problem

Time limit2sMemory limit256 MB

Summary
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.

Examples6

  1. Example 1

    Input
    Problematic pair programming
    "There’s a joke that pairs, like fish and house guests, go
    rotten after three days," said Zach Brock, an engineering
    manager. Working out problems with a pairing partner can be
    a lot like working out problems with a significant other.
    During one recent rough patch, Jamie Kite, a developer, sat
    her partner down for a talk. "Hey, it feels like we’re
    driving in different directions," she recalls saying. "It’s
    like any relationship," Ms. Kite said. "If you don’t talk
    about the problems, it’s not going to work." When those
    timeouts don’t solve the problem, partners can turn to
    on-staff coaches who can help with counseling. "People who
    have been pairing a while, they’ll start acting like old
    married couples," said Marc Phillips, one of the coaches.
    People can be as much of a challenge as writing software.
    (Excerpted from "Computer Programmers Learn Tough Lesson in
    Sharing"; Wall Street Journal, August 27, 2012)
    
    Expected output
    yes
    no
    no
    yes
    yes
    no
    no
    no
    no
    yes
    yes
    no
    no
    no
    no
    no
    no
    
  2. Example 2

    Input
    problem
    PROBLEM
    Problem
    pRoBlEm
    PrObLeM
    
    Expected output
    yes
    yes
    yes
    yes
    yes
    
  3. Example 3

    Input
    problems
    problematic
    nonproblem
    unproblematic
    probem
    problm
    roblem
    proble
    rpoblem
    
    Expected output
    yes
    yes
    yes
    yes
    no
    no
    no
    no
    no
    
  4. Example 4

    Input
    no match here
    
    PROBLEMS ahead
    
    still nothing
    
    Expected output
    no
    no
    yes
    no
    no
    
  5. Example 5

    Input
    problem
    
    Expected output
    yes
    
  6. Example 6

    Input
    nothing to report here
    
    Expected output
    no