Pattern for Reverse Character Bridge
Submissions: 329   Accuracy:

38.61%

  Difficulty: Basic   Marks: 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

 

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Sahil Chhabra
Author: Sahil_Chhabra


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.