C++ DP simple solution...
\n# Code\n\nclass Solution {\npublic:\n    const int mod=1e9+7;\n    int dp[101][201];\n    int helper(vector<int>&locations,int s,int e,int f)\n    {\n        
\n# Code\n```\nclass Solution {\npublic:\n    const int mod=1e9+7;\n    int dp[101][201];\n    int helper(vector<int>&locations,int s,int e,int f)\n    {\n        if(dp[s][f]!=-1)\n        return dp[s][f];\n        int ways=0;\n        if(s==e)ways=1;\n        for(int i=0;i<(int)locations.size();i++)\n        {\n            if(i==s)continue;\n            int left=f-abs(locations[i]-locations[s]);\n            if(left>=0)\n            ways=(ways+helper(locations,i,e,left))%mod;\n        }\n        return dp[s][f]=ways;\n    }\n    int countRoutes(vector<int>& locations, int start, int finish, int fuel) {\n        memset(dp,-1,sizeof(dp));\n        return helper(locations,start,finish,fuel);\n    }\n};\n```
['Dynamic Programming', 'Memoization', 'C++']