Distinct substrings count

Write codeHard35 minCitadel style

Your task

Given a string s of lowercase letters (0 <= len(s) <= 10^4), return the number of DISTINCT non-empty substrings of s. Duplicates are counted once. The answer fits in a 64-bit integer.

Examples

count_distinct_substrings(s: str) -> int
Example 1
Inputcount_distinct_substrings("abc")
Output6