#226. 统计特定子串出现次数

    ID: 226 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatWarmup-2gesp3字符串暴力枚举

统计特定子串出现次数

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

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\