need help writing a program for practice program for my exam that is comming up i dont exactly know what to do. if someone can explain step by step how to do this i would appreciate it. here are the intructions for the sample exam question the teacher gave us.
Create a program that verifies Sudoku solutions:
a) Write a function that initializes a matrix with 9 lines and 9 columns from a file. The file should contain 9 lines, and each line should contain 9 numbers from 1 to 9 (separated by a space).
Example of input file (Sudoku.txt):
7 9 2 6 8 4 5 1 3
4 5 1 9 7 3 8 2 6
6 8 3 5 2 1 7 4 9
5 2 9 7 4 8 3 6 1
1 6 7 2 3 9 4 8 5
8 3 4 1 5 6 2 9 7
3 4 6 8 9 7 1 5 2
9 7 5 4 1 2 6 3 8
2 1 8 3 6 5 9 7 4

Write a function that takes as an argument a two-dimensional array with 9 lines and 9 columns (with integer elements), and verifies if the matrix contains a valid Sudoku solution.
The rules of Sudoku state that a Sudoku puzzle is solved when the 9x9 game board contains the numbers 1 through 9 exactly once in each row (see Figure 1), column (see Figure 2), and 3x3 box (see Figure 3). The numbers can appear in any order and diagonals are not considered.
The function should verify if all the rows are valid, all the columns are valid and also if all the 3x3 boxes are valid using ONLY loop structures (e.g. for loops). You can use any temporary variables including arrays if necessary. The validation should not use specific component references (i.e. m[0][0], m[0][1], m[0][2]), instead it should use more general component references (e.g. assuming col=1 and row=0, the previous 3 elements could be referred as m[row][col-1], m[row][col], m[row][col+1]).
The function should print the matrix in a Sudoku-like format (separating the 3x3 boxes by an extra space/line). The function should print a message for each inconsistencies detected on lines, columns or 3x3 boxes, and the messages should have the following format:
If no consistencies are found, the function should print the message "Valid Sudoku solution!"