Skip to content

Commit

Permalink
[Hacker Rank]: Staircase doc moved as Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
sir-gon committed Jul 27, 2023
1 parent fea055e commit ca3c260
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 66 deletions.
67 changes: 67 additions & 0 deletions src/hackerrank/warmup/staircase.md
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

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 $.
66 changes: 0 additions & 66 deletions src/hackerrank/warmup/staircase.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,3 @@
/**
* Staircase
*
* https://www.hackerrank.com/challenges/staircase
*
* Difficulty: #easy
* Category: #warmup
*
* Staircase detail
* This is a staircase of size n = 4:
* ```
* #
* ##
* ###
* ####
* ```
*
* 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
* Print a staircase as described above.
*
* # Input Format
* A single integer, , denoting the size of the staircase.
*
* Constraints
*
* 0 < n <= 100
*
* # Output Format
*
* Print a staircase of size n using # symbols and spaces.
*
* Note: The last line must have spaces in it.
*
* # Sample Input
* ```
* 6
* ```
*
* # Sample Output
* ```
* #
* ##
* ###
* ####
* #####
* ######
* ```
*
* # Explanation
* The staircase is right-aligned, composed of # symbols and spaces,
* and has a height and width of n = 6.
*/

export function staircase(n: number): string {
const result: string[] = [];

Expand Down

0 comments on commit ca3c260

Please sign in to comment.