3332. Maximum Points Tourist Can Earn
You are given two integers,
nandk, along with two 2D integer arrays,stayScoreandtravelScore.A tourist is visiting a country with
ncities, where each city is directly connected to every other city. The tourist’s journey consists of exactlyk0-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
currduring dayi, they will earnstayScore[i][curr]points.- Move to another city: If the tourist moves from their current city
currto citydest, they will earntravelScore[curr][dest]points.Return the maximum possible points the tourist can earn.
1 | class Solution { |