Count Distinct Substrings Leetcode Problems Sql