Skip to content

Instantly share code, notes, and snippets.

@OlukaDenis
Created August 17, 2019 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OlukaDenis/60156117fc48b595633e7a4905be72fc to your computer and use it in GitHub Desktop.
Save OlukaDenis/60156117fc48b595633e7a4905be72fc to your computer and use it in GitHub Desktop.
A simplest method to solve Hackerrank stairCase problem.
function stairCase(n){
let arr = Array(n-1).fill(' ')
for (let i = n-1; i >= 0; i--) {
arr[i] = '#';
console.log(arr.join(''));
}
}
stairCase(6)
@dilshod1d
Copy link

did not work??

@prav-raghu
Copy link

it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment