Draw Pattern With Optimal Loop Solution In C#

Take an integer input and then draw the pattern according to it.

Say for example if you enter 5 then, the pattern should be like below,

1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
5 5 5 5 5

There are several possible ways to achieve it. But the best way is with a single loop only with the below code.

using System;
using System.IO;

class CandidateCode {
    static void Main(String[] args) {
        int inputNumber = Convert.ToInt32(Console.ReadLine());
        for(int i = 1; i <= inputNumber; i++){
            Console.WriteLine("{0} {0} {0} {0} {0}",i);
        }
    }
}

With the above solution, it will consume the below time and memory.

C# Draw Pattern with optimal loop solution

Thanks!