-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Hacker Rank]: Staircase doc moved as Markdown
- Loading branch information
Showing
2 changed files
with
67 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# [Staircase](https://www.hackerrank.com/challenges/staircase) | ||
|
||
Difficulty: #easy | ||
Category: #warmup | ||
|
||
Staircase detail | ||
This is a staircase of size $ n = 4 $: | ||
|
||
```text | ||
# | ||
## | ||
### | ||
#### | ||
``` | ||
|
||
Its base and height are both equal to n. 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 n. | ||
|
||
## Function Description | ||
|
||
Complete the staircase function in the editor below. | ||
|
||
staircase has the following parameter(s): | ||
|
||
* int n: an integer | ||
|
||
|
||
Print a staircase as described above. | ||
|
||
## Input Format | ||
|
||
A single integer, , denoting the size of the staircase. | ||
|
||
Constraints | ||
|
||
$ 0 < n \leq 100 $ | ||
|
||
## Output Format | ||
|
||
Print a staircase of size n using # symbols and spaces. | ||
|
||
Note: The last line must have spaces in it. | ||
|
||
## Sample Input | ||
|
||
```text | ||
6 | ||
``` | ||
|
||
## Sample Output | ||
|
||
```text | ||
# | ||
## | ||
### | ||
#### | ||
##### | ||
###### | ||
``` | ||
|
||
## Explanation | ||
|
||
The staircase is right-aligned, composed of # symbols and spaces, | ||
and has a height and width of $ n = 6 $. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters