bottom-up dp
\n# Code\npython3 []\nclass Solution:\n    def maxScore(self, n: int, k: int, stayScore: List[List[int]], travelScore: List[List[int]]) -> int:\n        dp = [[
\n# Code\n```python3 []\nclass Solution:\n    def maxScore(self, n: int, k: int, stayScore: List[List[int]], travelScore: List[List[int]]) -> int:\n        dp = [[0] * n for _ in range(k + 1)]\n        for day in range(k - 1, -1, -1):\n            \n            for city in range(n):\n                score = dp[day + 1][city] + stayScore[day][city]\n                for dest in range(n):\n                    score = max(score, dp[day + 1][dest] + travelScore[city][dest])\n                dp[day][city] = score\n        \n        return max(dp[0])\n\n        \n```
[]