Simple C++ Solution || (Using Memoization) ✅✅
Code\ncpp []\nclass Solution {\npublic:\n    int helper(vector<vector<int>>& stay,vector<vector<int>>& travel,int day,int k,int city,int n,vector<vector<int>> &
# Code\n```cpp []\nclass Solution {\npublic:\n    int helper(vector<vector<int>>& stay,vector<vector<int>>& travel,int day,int k,int city,int n,vector<vector<int>> &dp){\n        if(day>=k){\n            return 0;\n        }\n        if(dp[day][city]!=-1){\n            return dp[day][city];\n        }\n        int ans=0;\n        for(int i=0;i<n;i++){\n            if(city!=i){\n                ans=max(ans,travel[city][i]+helper(stay,travel,day+1,k,i,n,dp));\n            }\n        }\n        return dp[day][city]=max(ans,stay[day][city]+helper(stay,travel,day+1,k,city,n,dp));\n    }\n    int maxScore(int n, int k, vector<vector<int>>& stayScore, vector<vector<int>>& travelScore) {\n        vector<vector<int>> dp(k,vector<int>(n,-1));\n        int ans=0;\n        for(int i=0;i<n;i++){\n            ans=max(ans,helper(stayScore,travelScore,0,k,i,n,dp));\n        }\n        return ans;\n    }\n};\n```
[]