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
给定一个n×n的网格,每个单元格包含一个非零数字。从左上角到右下角,你需要找到一条对称路径,每次只能向左、右、上、下移动,不能重复经过同一单元格。任务是找出所有有效路径中数字和最小的路径数量。
订阅专栏 解锁全文
658

被折叠的 条评论
为什么被折叠?



