Beating 100%
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```cpp []\nclass Solution {\npublic:\nint maxtravel(vector<vector<int>>& travelScore, int city, int n)\n{\n    int result = INT_MIN;\n\n    for(int i = 0; i<n; i++)\n    {\n        result = max(result,travelScore[i][city]);\n    }\n\n    return result;\n\n}\n\nint maxTravelDayPlus(vector<vector<int>>& dp, vector<vector<int>>& travelScore, int city, int day, int n)\n{\n    int result = 0;\n\n    for(int i = 0; i<n; i++)\n    {\n        int temp = dp[i][day];\n        int cost = travelScore[i][city];\n        result = max(result,temp+cost);\n    }\n\n    return result;\n\n}\n    int maxScore(int n, int k, vector<vector<int>>& stayScore, vector<vector<int>>& travelScore) {\n        int result = 0;\n        vector<vector<int>>dp(n, vector<int>(k,0));\n\n        for(int day = 0; day<k; day++)\n        {\n            for(int city = 0; city<n; city++)\n            {\n                if(day == 0)\n                {   \n                    int temp = maxtravel(travelScore, city, n);\n                    dp[city][day] = max(temp,stayScore[day][city]);\n                }\n                else\n                {\n                    int temp = dp[city][day-1] + stayScore[day][city];\n                    int temp2 = maxTravelDayPlus(dp, travelScore, city, day-1, n);\n                    dp[city][day] = max(temp,temp2);\n\n\n                }\n\n            }\n        }\n\n        for(int city = 0; city<n; city++)\n        {\n            result = max(result,dp[city][k-1]);\n        }\n\n        return result;\n    }\n};\n```
[]