You are given two integers, n and k, representing the total number of cities numbered from n
You are also given two
stayScore of size k $ imes$ n, where stayScore[i][j] represents the points earned if you remain in city j on day i.
travelScore of size n $ imes$ n, where travelScore[i][j] represents the points earned if you travel from city i to city j.
You may choose to start your journey in any city on day
On each day i from day k curr, you can perform exactly one of the following actions:
Stay in city curr and earn stayScore[i][curr] points.
Travel to any other city dest and earn travelScore[curr][dest] points, which updates your current location to city dest for the next day.
Return the maximum total points you can accumulate over the k days.
Constraints:
n
k
n travelScore.length travelScore[i].length stayScore[i].length
k stayScore.length
stayScore[i][j]
travelScore[i][j]
travelScore[i][i]
You are given two integers, n and k, representing the total number of cities numbered from n
You are also given two
stayScore of size k $ imes$ n, where stayScore[i][j] represents the points earned if you remain in city j on day i.
travelScore of size n $ imes$ n, where travelScore[i][j] represents the points earned if you travel from city i to city j.
You may choose to start your journey in any city on day
On each day i from day k curr, you can perform exactly one of the following actions:
Stay in city curr and earn stayScore[i][curr] points.
Travel to any other city dest and earn travelScore[curr][dest] points, which updates your current location to city dest for the next day.
Return the maximum total points you can accumulate over the k days.
Constraints:
n
k
n travelScore.length travelScore[i].length stayScore[i].length
k stayScore.length
stayScore[i][j]
travelScore[i][j]
travelScore[i][i]