My efficient solution
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```java []\nclass Solution {\n    public int maxScore(int n, int k, int[][] stayScore, int[][] travelScore) {\n        \n        int dp[] = new int[n];\n        for(int i=0; i<k; i++){\n            int tdp[] = dp.clone();\n            for(int j=0; j<n; j++){\n                tdp[j] = Math.max(tdp[j],dp[j]+ stayScore[i][j]);\n                for(int l=0; l<n; l++){\n                    if(l!=j){\n                        tdp[l] = Math.max(tdp[l], dp[j]+travelScore[j][l]);\n                    }\n                }\n            }\n            dp = tdp;\n        }\n        \n        int max = 0;\n        for(int i=0; i<n; i++){\n            max = Math.max(max, dp[i]);\n        }\n        return max;\n    }\n}\n```
[]