@@ -0,0 +1,1394 @@
+public class RobotMove %7B%0A    public int movingCount(int threshold, int rows, int cols)%0A    %7B%0A        boolean%5B%5D visited = new boolean%5Brows*cols%5D;%0A        for(int i=0; i%3Crows*cols; i++)%7B%0A            visited%5Bi%5D = false;%0A        %7D%0A        int count = movingCountCore(threshold, rows, cols, 0, 0, visited);%0A        return count;%0A        %0A    %7D%0A    %0A    public int movingCountCore(int threshold, int rows, int cols, int row, int col, boolean%5B%5D visited)%7B%0A        int count =0;%0A        if(check(threshold, rows, cols, row, col, visited))%7B%0A            visited%5Brow*cols +col%5D=true;%0A            count = 1+movingCountCore(threshold, rows, cols, row-1, col, visited)%0A                + movingCountCore(threshold, rows, cols, row+1, col, visited)%0A                + movingCountCore(threshold, rows, cols, row, col-1, visited)%0A                + movingCountCore(threshold, rows, cols, row, col+1, visited);%0A        %7D%0A        return count;%0A    %7D%0A    %0A    public boolean check(int threshold, int rows, int cols, int row, int col, boolean%5B%5D visited)%7B%0A        if(row%3E=0 && row%3Crows && col%3E=0 && col%3Ccols && getDigitSum(row)+getDigitSum(col) %3C= threshold && !visited%5Brow*cols+col%5D)%0A            return true;%0A        return false;%0A    %7D%0A    %0A    public int getDigitSum(int number)%7B%0A        int sum =0;%0A        while(number %3E0)%7B%0A            sum+=number%2510;%0A            number /=10;%0A        %7D%0A        return sum;%0A    %7D%0A%7D%0A

Create RobotMove.java