#301. 字符串子串计数比较

    ID: 301 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatString-2gesp3字符串

字符串子串计数比较

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

Output Format

The output should be printed to standard output in the following format.

Output true if "cat" and "dog" appear the same number of times; otherwise, output false.

Sample

catdog
true
catcat
false
1cat1cadodog
true

Sample Explanation

  • Sample 1: In the string "catdog\