Generate All Substrings Leetcode 754