1) Define an array
2) Read the input file into the array
3) Call a function using the array as an argument
4) Test the return from the function. True is a valid solution, false otherwise.
Then by supplying various files you could determine which are valid solutions.