#301. 字符串子串计数比较
字符串子串计数比较
Cat Dog Count
Background
Congcong is currently learning about string processing. He encountered an interesting problem that requires determining the number of occurrences of specific substrings in a given string.
Problem Description
Return true if the string "cat" and "dog" appear the same number of times in the given string. Otherwise, return false.
Input Format
The input is given from standard input in the following format.
A string .
Output Format
The output should be printed to standard output in the following format.
Output
trueif "cat" and "dog" appear the same number of times; otherwise, outputfalse.
Sample
catdog
true
catcat
false
1cat1cadodog
true
Sample Explanation
- Sample 1: In the string "catdog\