#C6002. Unique Substrings
Unique Substrings
Unique Substrings
Given a string \(S\), your task is to compute the number of unique substrings contained in \(S\). A substring is defined as any contiguous sequence of characters extracted from \(S\). For instance, if \(S = "abc"\), its unique substrings are: \(a, b, c, ab, bc, abc\) – hence, the answer is 6.
Note: If the string contains repeated characters, some substrings may be identical. Be sure to count each distinct substring only once.
inputFormat
The input consists of a single line containing the string \(S\). The string will contain only lowercase English letters.
outputFormat
Output a single integer denoting the number of unique substrings of \(S\).
## sampleabc
6
</p>