DAILY LEETCODE SOLUTION || EASY C++ SOLUTION
\nconst int mod = 1e9 + 7;\nclass Solution {\npublic:\n    long dp[101][201];\n    long fun(int city, int fuel, int start, int finish, vector<int>& locations, i
```\nconst int mod = 1e9 + 7;\nclass Solution {\npublic:\n    long dp[101][201];\n    long fun(int city, int fuel, int start, int finish, vector<int>& locations, int n){\n        if(dp[city][fuel] != -1) return dp[city][fuel];\n        long res = city == finish;\n        for(int nextCity = 0; nextCity < n; nextCity++){\n            if(nextCity == city or fuel < abs(locations[nextCity] - locations[city])) continue;\n            res = (res + fun(nextCity, fuel-abs(locations[nextCity]-locations[city]), start, finish, locations, n)) % mod;\n        }\n        return dp[city][fuel] = res % mod;\n    }\n    int countRoutes(vector<int>& locations, int start, int finish, int fuel) {\n        memset(dp, -1, sizeof(dp));\n        int n = locations.size();\n        return (int)fun(start, fuel, start, finish, locations, n);\n    }\n};\n```
['Array', 'Dynamic Programming', 'Recursion', 'Memoization', 'C']