https://www.hackerrank.com/challenges/staircase/problem?isFullScreen=true
Staircase | HackerRank
Print a right-aligned staircase with n steps.
www.hackerrank.com
Staircase detail
This is a staircase of size :
#
##
###
####
Its base and height are both equal to . It is drawn using # symbols and spaces. The last line is not preceded by any spaces.
Write a program that prints a staircase of size .
Function Description
Complete the function with the following parameter(s):
- : an integer
Print a staircase as described above. No value should be returned.
Note: The last line is not preceded by spaces. All lines are right-aligned.
Input Format
A single integer, , denoting the size of the staircase.
Constraints
.
Sample Input
6
Sample Output
#
##
###
####
#####
######
Explanation
The staircase is right-aligned, composed of # symbols and spaces, and has a height and width of .
'알고리즘 단련장 > 해커랭크' 카테고리의 다른 글
[해커랭크] Birthday Cake Candles (0) | 2025.08.06 |
---|---|
[해커랭크] Mini-Max Sum (0) | 2025.08.06 |
[해커랭크] Plus Minus (1) | 2025.07.27 |
[해커랭크] Diagonal Difference (1) | 2025.07.27 |
[해커랭크] A Very Big Sum (0) | 2025.07.27 |