Please enter your email address or userHandle.
Given a number N, generate all the possible cyclic permutations of the number.
Input : 123
Output : 123
Input : 5674
Output : 5674
The first line consists of an integer T i.e number of test cases.Each testcase follows single line input i.e, integer n.
Print all cyclic permutations with spaces in between.
1 <= T <= 100
1 <= n <= 109
123 312 231
5674 4567 7456 6745
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.