✅ One Line Solution
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)Code #1Time complexity: O(n). Space complexity: O(1)
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)

# Code #1
Time complexity: $$O(n)$$. Space complexity: $$O(1)$$.
```python3
class Solution:
    def maxScoreSightseeingPair(self, a: List[int]) -> int:
        return reduce(lambda p,v:(max(p[0],p[1]+v),max(p[1],v)-1),a,(0,0))[0]
```
[Ref](https://leetcode.com/problems/best-sightseeing-pair/solutions/260850/JavaC++Python-One-Pass-O(1)-space/)

# Code #2
Time complexity: $$O(n)$$. Space complexity: $$O(1)$$.
```python3
class Solution:
    def maxScoreSightseeingPair(self, a: List[int]) -> int:
        return max(map(sum,zip(a[1:],accumulate(a,lambda q,v:max(q-1,v)))))-1
```
[Ref](https://leetcode.com/problems/best-sightseeing-pair/solutions/1715803/python-2-line-solution-clean-and-concise-o-n/)

(Disclaimer 2: code above is just a product of fantasy packed into one line, it is not claimed to be 'true' oneliners - please, remind about drawbacks only if you know how to make it better)
['Array', 'Dynamic Programming', 'Python', 'Python3']