![]() |
VOOZH | about |
We have to print the pattern as given in the below example.
Examples :
Input : 5 Output : 1 1*2 1*2*3 1*2 1 Input : 9 Output : 1 1*2 1*2*3 1*2*3*4 1*2*3*4*5 1*2*3*4 1*2*3 1*2 1
Output:
1 1*2 1*2*3 1*2 1
Time Complexity: O(n2), where n represents the given input.
Auxiliary Space: O(1), no extra space is required, so it is a constant.