Leaderboard
Showing:
Pattern for Reverse Character Bridge
Basic Accuracy: 40.9% Submissions: 445 Points: 1

For a given value N, denoting the number of Characters starting from the A, print reverse character bridge pattern.

Input:

The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows, a single line of the input containing a positive integer N.
Output:

Print reverse character bridge pattern for each testcase.


Constraints:

1<=T<=50

1<=N<=26
Example:

Input:

2

5

8

Output:

ABCDEDCBA
ABCD  DCBA
ABC       CBA
AB            BA
A                 A

ABCDEFGHGFEDCBA
ABCDEFG GFEDCBA
ABCDEF   FEDCBA
ABCDE     EDCBA
ABCD       DCBA
ABC         CBA
AB           BA
A             A

 

 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Pattern for Reverse Character Bridge

Output Window