Count Distinct Substrings Leetcode Two Robots