You are viewing a single comment's thread. Return to all comments →
Here is my solution for javascript:
function staircase(n) { let star = "" for (let i = 0; i < n ; i++) { for (let j = n - 1; j > i; j--) { star += " "; } for (let k = i; k >= 0; k--) { star += "#"; } star += "\n"; } console.log(star) }
Seems like cookies are disabled on this browser, please enable them to open this website
Staircase
You are viewing a single comment's thread. Return to all comments →
Here is my solution for javascript: