SHould be marked medium Not hard, simple dp
Intuition\nJust think o states and base cases and you are good to go\n Describe your first thoughts on how to solve this problem. \n\n\n\n\n# Complexity\n- Time
# Intuition\nJust think o states and base cases and you are good to go\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n\n\n\n# Complexity\n- Time complexity:O(n*n*fuel)  (n=locations.size());\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n*fuel)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n\nint mod=1e9+7;\nint dp[101][201];\nint solve(int index,int fuel,int finish,vector<int> &locations){\n    if(fuel<0)\n    return 0;\n    if(index==finish){\n\n int   ans=1;\n\n        for(int i=0;i<locations.size();i++){\n            if(i!=index){\n                ans=(ans%mod+solve(i,fuel-abs(locations[index]-locations[i]),finish,locations)%mod)%mod;\n            }\n        }\n\n        return ans;\n    }\n\n    if(dp[index][fuel]!=-1)\n    return dp[index][fuel]%mod;\n\n    int ans=0;\n\n\n    for(int i=0;i<locations.size();i++){\n\n        if(i!=index){\n            ans=(ans%mod+solve(i,fuel-abs(locations[index]-locations[i]),finish,locations)%mod)%mod;\n        }\n    }\n\n    return dp[index][fuel]=ans%mod;\n}\n    int countRoutes(vector<int>& locations, int start, int finish, int fuel) {\n        memset(dp,-1,sizeof(dp));\n        return solve(start,fuel,finish,locations);\n    }\n};\n```
['Dynamic Programming', 'C++']