The pattern will consist of ‘N’ lines.
For 1 <= ‘i’ <= ‘N’ ‘i’th line consists of a string of ‘N’ + 1 - ‘i’ ‘*’ characters.
If ‘N’ is 5 then the pattern will be.
*****
****
***
**
*
The first line of input contains an integer 'T' representing the number of test cases.
Then each test case contains a single integer ‘N’ denoting the size of the pattern.
The output for each test case will be 'N' strings denoting the pattern printed for the given ‘N’ number of rows.
The output of each test case will be printed in a separate line.
1 <= T <= 5
1 <= N <= 500
Where ‘T’ is the number of test cases, ‘N’ is the size of the pattern.
You do not need to print anything, it has already been taken care of. Just implement the given function.
The idea is here to first create a string of ‘N’ ‘*’ characters, and modify this string for each step. The 1st line of the pattern will always consist of ‘N’ characters, so we will first create a string of size ‘N’ and then we will decrease the length by 1 in each step till we get an empty string.