Think about it.
The outer loop is responsible for the number of rows in the output.
The inner loop is responsible for the number of digits in each row.
Is the problem in the outer or in the inner loop?
How many times does the body of the inner loop execute?
How many times should the body of the inner loop execute?
The solution is very simple. You just have
to replace one character with another one.
Last edited on