GO Solution For UVa 10102 - The path in the colored field. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

The square field consists of M ×M cells. Each cell is colored in one of three colors (1,2,3). The initial state is chosen in one of the cells of color 1. In each step one allowed to move one cell up, down, left or right remaining inside the field.

You are to define the minimal amount of steps one s

...

You can find the full details of the problem The path in the colored field at UVa Online Judge

Sample Input

4
1223
2123
2213
3212
2
12
33

Sample Output

3
1

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

Solution originally posted at: Github by @codingsince1985