AmazonOA #180
Find Number of Possible Unique Strings
估计中等可在线判题
Choose any non-empty contiguous substring and reverse it once. Find how many distinct strings can be obtained. Reversing a substring of length 1 is allowed, so the original string is included.
输入格式
One line containing a lowercase string of length 1..100000.
输出格式
Output a single integer, the answer.
样例 1
输入:
abc
输出:
4
样例 2
输入:
aaa
输出:
1
样例 3
输入:
aba
输出:
3
样例说明
The answers are 4, 1 and 3.