#226. 统计特定子串出现次数
统计特定子串出现次数
Count Specific Substrings
Background
Congcong is very interested in string processing. He is learning how to identify specific patterns within strings.
Problem Description
Given a string, recursively count the total number of "abc" and "aba" substrings that appear in the given string.
Input Format
Input is given from standard input in the following format.
A single line containing a string .
Output Format
Output is printed to standard output in the following format.
A single integer representing the total count of occurrences of substrings "abc" and "aba".
Sample
abc
1
abcxxabc
2
abaxxaba
2
Sample Explanation
- Sample 1: In the string "abc\