Count Distinct Substrings Leetcode Sql