Skip to content

Instantly share code, notes, and snippets.

@OlukaDenis
Created August 17, 2019 09:49
Show Gist options
  • 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)
@prav-raghu
Copy link

it works

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