Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

staircase

// Staircase detail
// drawing a staircase with the best case
let n = 5; // you can change value of (n)
for (let i = 1; i <= n; i++) {
    console.log("#".repeat(i).padStart(n));
}
 
PREVIOUS NEXT
Tagged: #staircase
ADD COMMENT
Topic
Name
2+5 =