Company: pepciso_27sep
Difficulty: medium
Count Name Occurrences Problem Description The agent gave Martin a hint that the number of terrorists is the number of times the terrorist's name occurs in the text. Write an algorithm to help Martin find the number of terrorists who are going to attack the army base. Input The first line of the input consists of a string text , representing the text portion of the secret information shared by the agent. The second line consists of a string name representing the name of the terrorist. Output Print an integer representing the number of terrorists who are going to attack the army base. If no occurrence of name is found in text then print 0. Note The name matching is case insensitive (i.e., "Tim" is equivalent to "tim"). Overlapping instances of the name may appear in the text. The input strings text and name consists of English letters only. Examples Example 1: Input: TimsplayinginthehouseofTimwiththetoysofTim Tim Output: 3 Explanation: Tim occurs 3 times in the text of the secret inform