#ARC130A. [ARC130A] Remove One Character
[ARC130A] Remove One Character
Score : points
Problem Statement
You are given a string of length . For each , let denote the string obtained by deleting the -th character from .
Find the number of pairs of integers that satisfy both of the conditions below.
Constraints
- is a string of length consisting of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
7
abbbcca
4
Here are the strings in order: bbbcca, abbcca, abbcca, abbcca, abbbca, abbbca, abbbcc.
The following pairs satisfy the conditions.
4
xxxx
6
2
pp
1
2
st
0