The functions you wrote are not exactly what you need. Your functions only check how many times a single number is in a row (column or box).
To tell if a row (column or box) is good, you really need to check all numbers (1-9), not just one of them.
However, the good news is you can implement the needed functions using your functions:
public boolean isGoodRow( int yRowParam ){
// for number = 1,..,9, ensure the count is not > 1
for(int i=1; i<=9; i++)
if(timesRowHas(yRowParam, i) > 1)
return false;
return true;
}
(In case you are interested): This is not the most efficient solution, it runs in O(n2) time. isGoodRow() can be found in O(n) time by histograming the #'s in the row.
Once you have implemented the necessary functions:
public boolean isGoodRow( int yRowParam )
public boolean isGoodColumn( int xColParam )
public boolean isGoodBlock(int xBlockP, int yBlockP)
Then you just need to use those to implement checkAndPrintReport()
:
public boolean checkAndPrintReport(){
for(int i=0; i<9; i++)
if(!isGoodRow(i) || !isGoodColumn(i) || !isGoodBlock(i/3, i%3)
return false;
return true;
}