Instead of printing increasing numbers from 1 to i in each row, we print the row number i itself repeatedly i times. Row 1 has '1', row 2 has '2 2', row 3 has '3 3 3', and so on.
- Use an outer loop i from 1 to N for rows.
- For each row, use an inner loop j from 1 to i.
- Print i (the current row number) in each inner loop iteration.
- After completing one row, move to the next line.
- Time Complexity: O(N^2), because of the nested loop structure running N(N+1)/2 total operations.
- Space Complexity: O(1), as only loop variables are used.