areCellsInSameBox
Checks if two cells are in the same box based on their indices.
Throws an IllegalArgumentException with a specific message if either cell index is invalid.
This alternative way to check if two cells are in the same box uses their row and column indices directly.
Throws an IllegalArgumentException with a specific message if either row or column index is invalid.