from typing import List
classSolution:defmaxScoreSightseeingPair(self, values: List[int])->int:# res = A[i] + i + A[j] - j
res =0
pre_max = values[0]+0for j inrange(1,len(values)):
res =max(res, pre_max + values[j]- j)
pre_max =max(pre_max, values[j]+ j)return res