Count Distinct Substrings Leetcode Two Sums Solution Definition