Print Unique Subsets
Medium

Problem Statement

Given a string that may contain duplicates, find all of its unique subsequences. Give any solution out of multiple solutions

Examples

1Example 1
Input:
{ "s": "aab" }
Output:
[ "", "b", "a", "ab", "aa", "aab" ]
2Example 2
Input:
{ "s": "aba" }
Output:
[ "", "a", "b", "ba", "ab", "aba", "aa" ]
3Example 3
Input:
{ "s": "ccc" }
Output:
[ "", "c", "cc", "ccc" ]
Loading...

Sign in to Run Code and Submit