Error
|
|
---|---|
@Ibrahim Nash | 5765 |
@blackshadows | 5715 |
@akhayrutdinov | 5111 |
@mb1973 | 4993 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 1286 |
@bt8816103042 | 739 |
@rohitanand | 495 |
@codeantik | 479 |
@shalinibhataniya1097 | 472 |
@amrutakashikar2 | 464 |
@thealchemist627 | 456 |
@akashkale117 | 453 |
@shivanandp12345678910 | 453 |
@dalwainazism125 | 453 |
@SherlockHolmes3 | 447 |
Complete Leaderboard |
Given a pattern as below and an integer n your task is to decode it and print nth row of it. The pattern follows as :
1
11
21
1211
111221
............
Input:
The first line of input is the number of test cases . Then T test cases follow . The first line of each test case is an integer N.
Output:
For each test case print the required nth row of the pattern.
Expected Time Complexity : O(N2)
Expected Auxilliary Space : O(1)
Constraints:
1<=T<=20
1<=N<=20
Example:
Input:
2
2
3
Output:
11
21
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes