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.
- Prepare
- Algorithms
- Warmup
- Staircase
- Discussions
Staircase
Staircase
Sort by
recency
|
5193 Discussions
|
Please Login in order to post a comment
For Python3 Platform
I wrote the code from scratch just to get more practice
c++ solution:
Python:
def staircase(n): # Write your code here for i in range(1,n+1): text = '#'*i print(text.rjust(n))
a staircase is never just steps, it’s like frozen time between floors. u think u just climb, but really u pause between where u were and where u wanna be.
for (let i = 1; i <= n; i++) { let spaces = ' '.repeat(n - i); let hashes = '#'.repeat(i);
console.log(spaces + hashes); }