Count Distinct Substrings Leetcode Solutions