Count Distinct Substrings Leetcode Playground C