Problems > The Rook's Trip > Editorial

The Rook's Trip — Solution & Editorial

Back to the Problem

0 if already there; 1 if it shares a row or column; otherwise 2.

Complexity: O(1)