JAVA RECURSIVE+MEMO(TOP-DOWN) SIMPLE SOLUTION FASTER THAN 80%
JAVA CODE IS: \n\nclass Solution {\n    Integer dp[][];\n    int mod=1000000000+7;\n    int find(int location[],int curr,int finish,int fuel){\n         if(fuel
JAVA CODE IS: \n```\nclass Solution {\n    Integer dp[][];\n    int mod=1000000000+7;\n    int find(int location[],int curr,int finish,int fuel){\n         if(fuel<0)\n            return 0;\n        if(dp[curr][fuel]!=null)\n            return dp[curr][fuel];\n        int count=curr==finish ? 1 : 0;\n        for(int i=0;i<location.length;i++){\n            if(i==curr||fuel-Math.abs(location[curr]-location[i])<0)\n                continue;\n            dp[i][fuel-Math.abs(location[curr]-location[i])]=find(location,i,finish,fuel-Math.abs(location[curr]-location[i]));\n            count=(count+dp[i][fuel-Math.abs(location[curr]-location[i])])%mod;\n        }\n        return dp[curr][fuel]=count;\n    }\n    public int countRoutes(int[] locations, int start, int finish, int fuel) {\n        dp=new Integer[locations.length+1][fuel+1];\n        return find(locations,start,finish,fuel);\n    }\n}\n```\n***PLEASE,UPVOTE IF THIS IS REALLY HELPFUL FOR YOU***
[]