Please enter your email address or userHandle.
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 :
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.
For each test case print the required nth row of the pattern.
Expected Time Complexity : O(N2)
Expected Auxilliary Space : O(1)
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.