Print Subsets | Print Power Set | Print all Subsequences
Easy

Problem Statement

Given a string, find all of its subsequences, which is also known as the power set.

Examples

1Example 1
Input:
{ "s": "ab" }
Output:
[ "", "b", "a", "ab" ]
2Example 2
Input:
{ "s": "abc" }
Output:
[ "", "c", "b", "bc", "a", "ac", "ab", "abc" ]
3Example 3
Input:
{ "s": "a" }
Output:
[ "", "a" ]
Loading...

Sign in to Run Code and Submit