![]() |
VOOZH | about |
Program to print the following pattern of a half diamond for N.
Example:
Input: N = 5
Output:1
2*3
4*5*6
7*8*9*10
11*12*13*14*15
11*12*13*14*15
7*8*9*10
4*5*6
2*3
1
This program is divided into four parts.
1 2*3 4*5*6 7*8*9*10 7*8*9*10 4*5*6 2*3 1
Time Complexity: O(N2)
Auxiliary Space: O(1) since we are not using any extra space