So for this problem we are asked to solve it with O(1) space. Just to make sure, does it mean that we cannot make changes to the board, e.g. mark the rooks with different number, like 2? Because if we could, then the solution would be trivial. So do we treat the board as only a boolean matrix, which can have only 0s and 1s? If so, are we allowed to to temporary assign 1 to the rooks during the execution of the algorithm?
Thanks,
Yev