C++ Very Simple Top Down DP Sol.
\n\n# Code\n\nclass Solution {\npublic:\n    int dp[101][201];\n    int mod = 1000000007;\n    int fun(vector<int>&l , int f , int in, int end){\n\n        if(d
\n\n# Code\n```\nclass Solution {\npublic:\n    int dp[101][201];\n    int mod = 1000000007;\n    int fun(vector<int>&l , int f , int in, int end){\n\n        if(dp[in][f] != -1){\n            return dp[in][f];\n        }\n\n        int ans = 0 ;\n        if(in == end){\n            ans = 1 ;\n        }\n        \n        for(int i=0 ; i<l.size() ; i++){\n            if(i != in && abs(l[in] - l[i])<= f ){\n                ans =  (ans + fun(l , f - abs(l[in] - l[i]) , i , end))%mod;\n            }\n        }\n\n        return dp[in][f] = ans ;\n    }\n    int countRoutes(vector<int>& locations, int start, int finish, int fuel) {\n        memset(dp , -1 , sizeof(dp));\n        return fun(locations , fuel , start , finish);\n    }\n};\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'C++']