HackerRank Staircase Problem - Solution Walkthrough (JavaScript)

preview_player
Показать описание
In this quick walkthrough, I'll explain how to approach and solve the Staircase problem from HackerRank. Its difficulty rating is 'Easy', and I'll be solving it in JavaScript.

Please leave any questions down below. Thanks for watching!
Рекомендации по теме
Комментарии
Автор

with java 11 plus you can use repeat() from the string class:

String hash = "#";
String space = " ";
for(int i = 1; i <= n; i++) {



}

In my opinion seems much cleaner

dghgfhjgnxdgfhtfyuiy
Автор

Using repeat on Javascript
console.log(' '.repeat(n-i) + '#'.repeat(i))

TheNorb
visit shbcf.ru