Skip to content

Commit ca3c260

Browse files
committed
[Hacker Rank]: Staircase doc moved as Markdown
1 parent fea055e commit ca3c260

File tree

2 files changed

+67
-66
lines changed

2 files changed

+67
-66
lines changed

src/hackerrank/warmup/staircase.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# [Staircase](https://www.hackerrank.com/challenges/staircase)
2+
3+
Difficulty: #easy
4+
Category: #warmup
5+
6+
Staircase detail
7+
This is a staircase of size $ n = 4 $:
8+
9+
```text
10+
#
11+
##
12+
###
13+
####
14+
```
15+
16+
Its base and height are both equal to n. It is drawn using # symbols
17+
and spaces. The last line is not preceded by any spaces.
18+
19+
Write a program that prints a staircase of size n.
20+
21+
## Function Description
22+
23+
Complete the staircase function in the editor below.
24+
25+
staircase has the following parameter(s):
26+
27+
* int n: an integer
28+
29+
## Print
30+
31+
Print a staircase as described above.
32+
33+
## Input Format
34+
35+
A single integer, , denoting the size of the staircase.
36+
37+
Constraints
38+
39+
$ 0 < n \leq 100 $
40+
41+
## Output Format
42+
43+
Print a staircase of size n using # symbols and spaces.
44+
45+
Note: The last line must have spaces in it.
46+
47+
## Sample Input
48+
49+
```text
50+
6
51+
```
52+
53+
## Sample Output
54+
55+
```text
56+
#
57+
##
58+
###
59+
####
60+
#####
61+
######
62+
```
63+
64+
## Explanation
65+
66+
The staircase is right-aligned, composed of # symbols and spaces,
67+
and has a height and width of $ n = 6 $.

src/hackerrank/warmup/staircase.ts

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,3 @@
1-
/**
2-
* Staircase
3-
*
4-
* https://www.hackerrank.com/challenges/staircase
5-
*
6-
* Difficulty: #easy
7-
* Category: #warmup
8-
*
9-
* Staircase detail
10-
* This is a staircase of size n = 4:
11-
* ```
12-
* #
13-
* ##
14-
* ###
15-
* ####
16-
* ```
17-
*
18-
* Its base and height are both equal to n. It is drawn using # symbols
19-
* and spaces. The last line is not preceded by any spaces.
20-
*
21-
* Write a program that prints a staircase of size n.
22-
*
23-
* # Function Description
24-
*
25-
* Complete the staircase function in the editor below.
26-
*
27-
* staircase has the following parameter(s):
28-
*
29-
* * int n: an integer
30-
*
31-
* # Print
32-
* Print a staircase as described above.
33-
*
34-
* # Input Format
35-
* A single integer, , denoting the size of the staircase.
36-
*
37-
* Constraints
38-
*
39-
* 0 < n <= 100
40-
*
41-
* # Output Format
42-
*
43-
* Print a staircase of size n using # symbols and spaces.
44-
*
45-
* Note: The last line must have spaces in it.
46-
*
47-
* # Sample Input
48-
* ```
49-
* 6
50-
* ```
51-
*
52-
* # Sample Output
53-
* ```
54-
* #
55-
* ##
56-
* ###
57-
* ####
58-
* #####
59-
* ######
60-
* ```
61-
*
62-
* # Explanation
63-
* The staircase is right-aligned, composed of # symbols and spaces,
64-
* and has a height and width of n = 6.
65-
*/
66-
671
export function staircase(n: number): string {
682
const result: string[] = [];
693

0 commit comments

Comments
 (0)