If the same string can be generated multiple times, return them multiple times.
The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then the test case follows.
The first and the only line of each test case contains the string 'STR'.
For each test case, print all the substrings with distinct characters.
Output for each test case will be printed in a new line.
You do not need to print anything; it has already been taken care of. Just implement the given functions.
1 <= T <= 100
1 <= |STR| <= 15
Where |STR| denotes the length of “STR”
String “STR” will only consist of lowercase English Alphabets.
Time Limit: 1 sec
We can generate all possible subsequences of the string, and for each subsequence check if it contains any character multiple times. If it doesn’t contain any character multiple times, append it into our result.
Algorithm:
Longest Palindromic Substring
Cakes
1-3 Palindrome
8-Queen Problem
Search Pattern (KMP - Algorithm)
Search Pattern (KMP - Algorithm)
Search Pattern (KMP - Algorithm)