public class Solution { public int searchTreasure (int[][] arr, int n, int m, int N, int M) { // write code here return helper(arr,0,0,n,m,N,M); } int helper(int[][] arr,int x,int y, int n, int m,int N,int M){ if(x>=N || y>=M)return 0; int max = Math.max(helper(arr,x+1,y,n,m,N,M), helper(arr,x,y+1,n,m,N,M)); for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(x+i<N && y+j<M && arr[x+i][y+j]>0){ int tmp = arr[x+i][y+j]; arr[x+i][y+j] = 0; max = Math.max(max, tmp + Math.max( helper(arr,x+1,y,n,m,N,M), helper(arr,x,y+1,n,m,N,M))); arr[x+i][y+j] = tmp; } } } return max; } } 求帮忙看下第一题哪里错了