Please enter your email address or userHandle.
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)
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.