Count Number Of Substrings Leetcode Python Solutions