Generate All Substrings Leetcode 150