We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functioncreateString(str,ns,n){if(ns>0)returncreateString(str+" ",ns-1,n);elseif(n>0&&ns===0)returncreateString(str+"#",ns,n-1);elseif(n===0&&ns===0)returnstr;}// Complete the staircase function below.functionstaircase(n){letns=n.length-1;console.log(createString("",ns,n));}
i was going to add a while loop but i keep getting undefined not sure the problem.
Cookie support is required to access HackerRank
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 →
i was going to add a while loop but i keep getting undefined not sure the problem.