25- String subsequences

String subsequences

Description

Given a string str, create a function that returns all its possible subsequences, the order doesn't matter.

Example 1:

  • Input: str = "abcd"
  • Output: ["abcd", "abc", "abd", "ab", "acd", "ac", "ad", "a", "bcd", "bc", "bd", "b", "cd", "c", "d", ""]
  • Explanation:

Try some input:

str =

Expected output:

Try to solve:

Select a language:






Solution:

Code:

Select a language:





Frequently asked questions:

No questions yet.
You can ask a question in comment section below.

Complete and Continue  
Discussion

0 comments