Back to problems

Maximum Vacation With Minimum Flights

Algorithm · Datadog · Medium

An avid traveler is organizing a vacation that lasts n consecutive weeks across m cities, labeled 0 through m-1. The trip begins in city 0 before the first week starts. The air network is fully connected: a direct flight exists between any two cities. Therefore, at the beginning of each week, the traveler may either remain in the current city or take a flight to any other city. Moving to a different city counts as one flight; staying put counts as zero flights. The number of…

Checking your access…