EASY DP|| recursioin-->memoization|| C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n\n    int mod=1e9+7;\n    long long helper(int start,int fuel, int finish, vector<int>&locations, vector<vector<long long>>&storage){\n        if(fuel<0)return 0;\n       // if(start==finish)return 1;\n        \n        if(storage[start][fuel]!=-1)return storage[start][fuel]%mod;\n        long long ans=0;\n        if(start==finish)ans+=1;\n        for(int index=0;index<locations.size();index++){\n            if(index==start)continue;\n\n            \n            \n            long long small = helper(index,fuel-abs(locations[index]-locations[start]),finish, locations,storage)%mod;\n              \n\n            ans=((ans%mod)+small)%mod;\n        }\n\n            return storage[start][fuel]=ans%mod;\n    }\n\n\n    int countRoutes(vector<int>& locations, int start, int finish, int fuel) {\n        vector<vector<long long>>storage(locations.size()+1,vector<long long>(fuel+1,-1));\n        return helper(start,fuel,finish,locations,storage)%mod;\n    }\n};\n```
['C++']