Count Unique Substring Leetcode