✅ One-pass, constant space || Python
\nclass Solution:\n    def maxScoreSightseeingPair(self, values: List[int]) -> int:\n        max_value = 0\n        i = 0\n        for j in range(1, len(values)
```\nclass Solution:\n    def maxScoreSightseeingPair(self, values: List[int]) -> int:\n        max_value = 0\n        i = 0\n        for j in range(1, len(values)):\n            value = values[i] + values[j] + i - j\n            max_value = max(max_value, value)\n            if values[i] - (j - i) < values[j]:\n                i = j\n                \n        return max_value\n```
['Dynamic Programming', 'Python']