#K91552. Diamond Pattern
Diamond Pattern
Diamond Pattern
Given an integer n, print a diamond pattern made of asterisks. The diamond consists of two parts. The first part is a pyramid with n rows, and the second part is an inverted pyramid with n-1 rows. In the pyramid, the i-th row (0-indexed) contains \(2i+1\) asterisks, preceded by \(n-i-1\) spaces to center the stars. For the inverted pyramid, the rows are the reverse of the first n-1 rows. If n = 0, simply output a newline character.
inputFormat
The input consists of a single integer n ((0 \le n \le 100)).
outputFormat
Output the diamond pattern corresponding to the provided n. Each line of the diamond (including the last one) ends with a newline character.## sample
1
*
</p>