[LeetCode] 864. Shortest Path to Get All Keys 获得所有钥匙的最短路径

匿名 (未验证) 提交于 2019-12-02 23:49:02



grid".""#""@""a""b", ...) are keys, and ("A""B", ...) are locks.

K

-1.

Example 1:

Input: ["@.a.#","###.#","b.A.B"] Output: 8

Example 2:

Input: ["@..aA","..B#.","....b"] Output: 6

Note:

  1. grid[i][j]'#''@''a'-``'f``''A'-'F'
  2. [1, 6]



Github 同步地址:

https://github.com/grandyang/leetcode/issues/864



参考资料:

https://leetcode.com/problems/shortest-path-to-get-all-keys/



LeetCode All in One 题目讲解汇总(持续更新中...)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!