Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.