A new video about the recent developments in coding has been published on the HackerEarth social media handle. After some time, it is seen that there are N comments added. The admin wants to see if there are any derogatory comments. Hence, he searched the comment section with a keyword S.
Task
Give the count of the comments that will be returned as a result of the search.
Notes
Example 1
Assumptions
Input
Output: 1
Approach
Only the second comment contains the word “hate”.
Function description
Complete the function solution() provided in the editor. The function takes the following 3 parameters and returns the solution:
Input format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
Output format
Print an integer representing the number of comments containing the keyword.
Constraints
1≤N≤1051≤|S|≤101≤Sumoflengthofallcomments≤105Sandcommentscontainonlyloweranduppercaselatincharactersandunderscores
Given
Input
Output: 2
Approach
Both comments contain the keyword “bad”.