Description
Solutions
DFS Subsequences of a String (For MLE)
πŸ‘©β€πŸŽ“ NEW GRAD

A DFS problem involving subsequences of a string. Given an input String, return a list containing every possible substring, with the requirement that they are sorted alphabetically. For example, given the input "abc", return ["a", "b", "c", "ab", "bc", "ac", "abc"].

Example 1:

Input:  s = "abc"
Output: ["a", "ab", "abc", "ac", "b", "bc", "c"]
Explanation:

The function should return all possible subsequences of the input string "abc" sorted alphabetically, which are: ["a", "ab", "abc", "ac", "b", "bc", "c"].

Constraints:
    πŸ₯πŸ₯
Thumbnail 0
Testcase

Result
Case 1

input:

output: