Best Sightseeing Pair
Pick two sightseeing spots to maximize the sum of their values minus the distance between them. A running best score updates as the scan passes each spot.
Pick two sightseeing spots to maximize the sum of their values minus the distance between them. A running best score updates as the scan passes each spot.