3332. Maximum Points Tourist Can Earn
You are given two integers,
n
andk
, along with two 2D integer arrays,stayScore
andtravelScore
.A tourist is visiting a country with
n
cities, where each city is directly connected to every other city. The tourist’s journey consists of exactlyk
0-indexed days, and they can choose any city as their starting point.Each day, the tourist has two choices:
- Stay in the current city: If the tourist stays in their current city
curr
during dayi
, they will earnstayScore[i][curr]
points.- Move to another city: If the tourist moves from their current city
curr
to citydest
, they will earntravelScore[curr][dest]
points.Return the maximum possible points the tourist can earn.
1 | class Solution { |