Count Distinct Substrings Leetcode Two