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
|
5088 Discussions
|
Please Login in order to post a comment
Here is my c++ implementation, you can watch the video here : https://youtu.be/4yntFcMY30U
def staircase(n): for i in range(1,n+1): print(' ' * (n - i) + '#' * i) if name == 'main': n = int(input().strip())
In pyhton
My code in golang:
My logic was: For each line print "n - t" spaces and "t #" and plus "t". But my code was a little bit different.