Count Distinct Substring Leetcode Contest