Back
Close
  • 90

Statement

 Goal

You are given a number, N, of glasses. Your job is to determine the largest pyramid that can be built with the glasses provided, and then create that pyramid in the output.

A glass is represented in ASCII as follows:


 ***    
* *
* *
*****
Input
A single integer: N, indicating the number of glasses.
Output
The ASCII pyramid

Example for N between 6 and 9:


       ***       
* *
* *
*****
*** ***
* * * *
* * * *
***** *****
*** *** ***
* * * * * *
* * * * * *
***** ***** *****
Constraints
0<N<30
Example
Input
4
Output
    ***    
    * *    
    * *    
   *****   
 ***   *** 
 * *   * * 
 * *   * * 
***** *****
Solve it

A higher resolution is required to access the IDE

codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants