Description
Solutions
DFS Subsequences of a String (For MLE)
π©βπ NEW GRADπRELATED PROBLEMS
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:
π₯π₯

Related Problems
Testcase
Result
Case 1
input:
output: