44. Number Pyramid
Core1000 ms256 MBSolved by 0%
Read an integer n and print a pyramid where each row contains the
numbers from 1 up to the row number, with no separators.
For n = 4:
1
12
123
1234
Constraints - `1 ≤ n ≤ 9`
Input
A single line containing one integer n.
Output
Print n lines: line i holds the digits 1 to i with nothing between them.
Input4
Output1
12
123
1234
Noteis the worked example from the statement
Input1
Output1
Noteis a single row
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.