Back
Close
  • 203

Statement

 Goal

You will be given a integer N, your goal is to draw the highest truncated pyramid that contains N “bricks”.
Each floor of a pyramid contains one brick more than the previous one.
Each brick is a * and each floor begins at the left of the line.
Be careful not to add spaces at the end of a line.
Input
Line 1: An integer N, the number of bricks you have
Output
The truncated pyramid
Constraints
1 ≤ N ≤ 1000
Example
Input
1
Output
*
Solve it

A higher resolution is required to access the IDE

Online Participants