CT091

Tikki’s Infinite Substring Bazaar

HardL10 · SingularityAcceptance: 0.0%XP: 600

Every distinct nonempty substring can be sold once. Compute how many different substring designs the bazaar can offer, even for a very long inscription. Input: one lowercase string. Output number of distinct nonempty substrings.

Example 1:

Input: ababa
Output: 9

Example 2:

Input: a
Output: 1

Example 3:

Input: aaa
Output: 3

Constraints:

1≤length≤200000.

Tags:

suffix-automaton strings
Loading...
Test Cases:No test cases
No test cases available.