Convert the 2D board into a 1D tuple to make it hashable.
Initialize a queue with the starting board state and a depth of 0.
Initialize a set to keep track of seen (visited) board states.
While the queue is not empty, dequeue the front node.
If the node is the target state, return the depth (number of moves).
Otherwise, for each neighbor (reachable state by making one move), if it has not been seen, add it to the seen set and enqueue it with an incremented depth.
If the queue is exhausted without finding the target state, return -1, indicating the solution is not possible.