cswork / OA打开练习工作台

AmazonOA #180

Find Number of Possible Unique Strings

估计中等可在线判题

考点(AI 标注)哈希计数位运算

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.