Distinct substrings
Your task
Given a string s, return the number of distinct non-empty substrings of s. Two substrings are the same if they are equal as strings (positions don't matter). 1 <= len(s) <= 1000, lowercase letters. Example: 'aba' has substrings a, b, ab, ba, aba = 5 distinct.
Examples
count_distinct_substrings(s: str) -> intExample 1
Input
count_distinct_substrings("aba")Output
5