cswork / OA打开练习工作台

UberOA #8

Substrings of Length 3 With Exactly Two Vowels

估计简单可在线判题

考点(AI 标注)双指针滑窗字符串

Count the contiguous substrings of length exactly 3 that contain exactly two vowels; vowels are a, e, i, o, u, and substrings may overlap.

This site's standard input and output are explicit.

输入格式

One line containing a lowercase string of length 0..1000, which may be an empty line.

输出格式

Output one integer, the answer.

样例 1

输入:

welcome

输出:

1

样例 2

输入:

输出:

0

样例 3

输入:

banana

输出:

2

样例说明

Example 1: elc has only 1 vowel, lco only 1, wel also only 1, and com also only 1; ome has 2, so the correct result is 1, and the original site's 2 is wrong. Example 2: there is no substring of length 3, so output 0. Example 3: the two ana windows each have two a's, so output 2.