Optimal Symmetric Paths
Optimal Symmetric Paths |
You have a grid of n rows and n columns. Each of the unit squares contains a non-zero digit. Youwalk from the top-left square to the bottom-right square. Each step, you can move left, right, up ordown to the adjacent square (you cannot move diagonally), but you cannot visit a square more thanonce. There is another interesting rule: your path must be symmetric about the line connecting thebottom-left square and top-right square. Below is a symmetric path in a6