Java: short & clear recursion
\nclass Solution {\n    public int maxScore(int n, int k, int[][] stayScore, int[][] travelScore) {\n        int[][] memo = new int[n][k];\n        for (var row
```\nclass Solution {\n    public int maxScore(int n, int k, int[][] stayScore, int[][] travelScore) {\n        int[][] memo = new int[n][k];\n        for (var row:memo) Arrays.fill(row,-1);\n        int res = 0;\n        for (int city = 0; city < n; city++){\n            res = Math.max(res, dfs(city, 0, k, stayScore, travelScore, memo));\n        }\n        return res;\n    }\n\n    int dfs(int city, int day, int k, int[][] stayScore, int[][] travelScore, int[][] memo) {\n        if (day == k) return 0;\n        if (memo[city][day] != -1) return memo[city][day];\n        int res = stayScore[day][city] + dfs(city, day + 1, k, stayScore, travelScore, memo); //stay\n        for (int next = 0; next < travelScore[city].length; next++){\n            res = Math.max(res, travelScore[city][next] + dfs(next, day + 1, k, stayScore, travelScore, memo)); //travel\n        }\n        return memo[city][day] = res;\n    }\n}\n```
[]