GO Solution For UVa 10422 - Knights in FEN. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

There are black and white knights on a 5 by 5 chessboard. There are twelve of each color, and there is one square that is empty. At any time, a knight can move into an empty square as long as it moves like a knight in normal chess (what else did you expect?).

Given an initial position of the board,

...

You can find the full details of the problem Knights in FEN at UVa Online Judge

Sample Input

2
01011
110 1
01110
01010
00100
10110
01 11
10111
01001
00000

Sample Output

Unsolvable in less than 11 move(s).
Solvable in 7 move(s).

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985