Count Distinct Substrings Leetcode 150