Count Distinct Substrings Leetcode Problems Javascript W3schools