jizzel / algo-dsa

leetcode
0 stars 0 forks source link

MISC-[Java/Python]-02: Generate ASCII Pyramid #31

Open jizzel opened 3 weeks ago

jizzel commented 3 weeks ago

We can render an ASCII art pyramid with N levels by printing N rows of asterisks, where the top row has a single asterisk in the center and each successive row has two additional asterisks on either side.

Here's what that looks like when N is equal to 3.

  *  
 *** 
*****

And here's what it looks like when N is equal to 5.

    *    
   ***   
  ***** 
 ******* 
********* 

Can you write a program that generates this pyramid with a N value?

ABIGAILDEBBY commented 3 weeks ago

Good job on this!