虽然机器人可以上下左右移动,但是从(0,0)出发向下、向右遍历已经可以遍历所有满足要求的节点因此只需向下向右进行递归,类似二叉树,因为会出现重复,用二维数组进行标记 public class Solution { public int movingCount(int threshold, int rows, int cols) { boolean flag[][]=new boolean[rows][cols]; return dfs(threshold,rows,cols,0,0,flag); } public int dfs(int ...