摘要:
This is a easier common grap and look for shortest path problem, time complexity: O(m*n): class Solution { public int getFood(char[][] grid) { int m = 阅读全文
摘要:
This is graph and look for the shortest path, so BFS should be solution. But how to handle K? We can look K as a parameter of every node. My first sol 阅读全文
摘要:
This is a graph problem, and the problem try to find the shortest path. So BFS is just right solution, the following is my first solution. It works bu 阅读全文