Diamond of Stars

Moderate
0/80
13 upvotes
Asked in company
MediaTek

Problem statement

Note: N is always odd.


Pattern for N = 5


The dots represent spaces.



Detailed explanation ( Input/output format, Notes, Images )
Input format :
N (Total no. of rows and can only be odd)
Output format :
Pattern in N lines
Constraints :
1 <= N <= 49
Sample Input 1:
5
Sample Output 1:
  *
 ***
*****
 ***
  *
Sample Input 2:
3
Sample Output 2:
  *
 ***
  *
Approaches (1)
Time Complexity
Space Complexity
Code Solution
(100% EXP penalty)
Diamond of Stars
Full screen
Console