Count Distinct Substrings Leetcode Premium