![]() |
VOOZH | about |
Given an integer N, print N rows of an inverted right half pyramid pattern. In an inverted right half pattern of N rows, the first row has N number of stars, the second row has (N - 1) number of stars, and so on till the Nth row, which has only 1 star.
Examples:
Input: n = 5
Output:
*****
****
***
**
*Input: n = 3
Output:
***
**
*
***** **** *** ** *
Time Complexity: O(N^2), where N is the number of rows in the pattern.
Auxiliary Space: O(1)