Quote:
I had no clue to reach this one.
As programmer, your job is to decipher problems. you will get good at this only by practicing.
Look at this pattern:
1 1 1 1 1
1 2 3 4 5
2 2 2 2 2
1 2 3 4 5
3 3 3 3 3
1 2 3 4 5
I just
pivoted transposed your problem, columns are rows, and row are columns.