Count Distinct Substrings Leetcode Contest Sunday