FirstHack Learn
Log in Sign up free
← All problems

Star Triangle Pattern

Easy 1 solved

Star Triangle Pattern

Given an integer N, print a right-angled triangle of asterisks with N rows.

Row 1 has one *, row 2 has two, and so on until row N, which has N of them. There are no spaces before or between the stars.

For N = 3 the output is three lines: , then , then .

This is the standard nested-loop exercise: an outer loop for the rows, an inner loop for the stars in a row.

Input

A single line containing one integer N.

Output

N lines, where line i contains exactly i asterisks.

Constraints

1 <= N <= 50

Example 1
Input
3
Output
*
**
***

Row 1 has one star, row 2 has two, row 3 has three.

Submit runs your code against 4 test cases — the 1 shown above plus 3 hidden ones covering the awkward cases. Run sample just tries the first example, which is usually what you want while you are still working it out.