Given a string of a constant length, print a triangle out of it. The triangle should start with the given string and keeps shrinking downwards by removing one character from the begining of the string. The spaces on the left side of the triangle should be replaced with dot character.
Input: First line of the input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of a single line contaning a string of length N.
Output: Corresponding to each test case, a pattern of triangle is printed in N lines.
Constraints:
1 <=T<= 30
N = 5
Example:
Input:
2
Geeks
@io30
Output:
Geeks
.eeks
..eks
...ks
....s
@io30
.io30
..o30
...30
....0
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.
preparecodinginterview_dot_com | 190 |
__murugan__ | 173 |
manvimahajan20 | 140 |
xiaoyan_yunche | 139 |
ShameekAgarwal | 116 |
preparecodinginterview_dot_com | 190 |
__murugan__ | 173 |
manvimahajan20 | 166 |
SoumyaKaushik | 146 |
arpit_anshuman | 140 |
blackshadows | 5331 |
Ibrahim Nash | 5219 |
akhayrutdinov | 5111 |
mb1973 | 4929 |
Quandray | 4567 |