Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them. Output should be printed in sorted increasing order of strings.
First line contains the test cases T. 1<=T<=10
Each test case have one line string S of characters of length N. 1<=N<=10
One line per test case, every string enclosed in ().(See example). Output should be printed in sorted order.
(A B C)(A BC)(AB C)(ABC)
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.