How to take input for the elements of the array in this question

how can I take input for elements of the array in this question as we have only declared the number of rows and columns here.

hi @Subham-Rai-930012170528208, bhaiya has used a variable named val for that everytime you insert tha value you increment that val by 1