C++ || O(n*fuel)
\n#define ll long long\n#define m 1000000007\nclass Solution {\npublic:\n    int dp[101][201];\n    int helper(vector<int>& v,int n, int s, int e, int f){\n    
```\n#define ll long long\n#define m 1000000007\nclass Solution {\npublic:\n    int dp[101][201];\n    int helper(vector<int>& v,int n, int s, int e, int f){\n        if(dp[s][f]!=-1) return dp[s][f];\n        ll ans=0;\n        if(s==e) ans++;\n        for(int i=0;i<n;i++){\n            if(i!=s){\n                if(abs(v[s]-v[i])<=f) ans=(ans+helper(v,n,i,e,f-abs(v[s]-v[i]))%m)%m;\n            }\n        }return dp[s][f]=ans%m;\n    }\n    int countRoutes(vector<int>& v, int s, int e, int f) {\n        memset(dp,-1,sizeof(dp));\n        return helper(v,v.size(),s,e,f);\n    }\n};\n```
[]