Problems > Words Containing C

Words Containing C

Difficulty: 800 2000 ms 128 MB

strings

Count how many of the words contain the character C at least once.

Input: the first line has words separated by spaces; the second line has the single character C.

Output: the count of words containing C.

Constraints:

  • 1 to 200 lowercase words

Sample Tests

Input 1
apple banana cherry
a
Output 1
2
Input 2
dog cat
z
Output 2
0

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.