areCellsInSameBox

fun Dimension.areCellsInSameBox(cellIndex1: Int, cellIndex2: Int): Boolean

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.


fun Dimension.areCellsInSameBox(row1: Int, col1: Int, row2: Int, col2: Int): Boolean

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.