**By: Saurav**

**2017-12-29 20:48:00 UTC**

Consider a staircase of size 4:

#

##

###

####

Observe that its base and height are both equal to 4, and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces.

Write a program that prints a staircase of size n.

Input Format

A single integer,n, denoting the size of the staircase.

Output Format

Print a staircase size n using # symbols and spaces.

Note: The last line must have 0 spaces in it.

Sample Input

6

Sample Output

#

##

###

####

#####

######

Explanation

Although above its being shown left aligned, the staircase is right-aligned, composed of # symbols and spaces, and has a height and width of 6.

This an easy but interesting problem where number of spaces is decreasing and number of # are increasing.

Going through our steps to solve any algo problems, we see clearly, there is a mathematical pattern between these two where the sum is always equal to n but space number is decreasing and # number is increasing.

lets clean it a little and remove repetitions.

Owned & Maintained by Saurav Prakash

If you like what you see, you can help me cover server costs or buy me a cup of coffee though donation :)