Simple python top down approach.
\n\n# Code\npython3 []\nclass Solution:\n    def maxScore(self, n: int, k: int, ss: List[List[int]], ts: List[List[int]]) -> int:\n        di=[[-1 for _ in rang
\n\n# Code\n```python3 []\nclass Solution:\n    def maxScore(self, n: int, k: int, ss: List[List[int]], ts: List[List[int]]) -> int:\n        di=[[-1 for _ in range(201)] for _ in range(201)]\n        def f(d,c):\n            if d==k:\n                return 0\n            if di[d][c] != -1:\n                return di[d][c]\n            \n            res=ss[d][c]+f(d+1,c)\n            for i in range(n):\n                \n                if i!=c:  \n                    res=max(res,ts[c][i]+f(d+1,i))\n            di[d][c]=res  \n            return res\n        re=0\n        for i in range(n):\n            re=max(re,f(0,i))\n            #print(re)\n        return re\n        \n            \n```
[]