[Py/Py3] DP Solution with comments
Soln 1: Note this is more concise solution w.r.t soln 2. Soln 2 is converted to Soln 1.\n> \n\n\nfrom math import inf\n\nclass Solution:\n    def maxScoreSights
> Soln 1: Note this is more concise solution w.r.t soln 2. Soln 2 is converted to Soln 1.\n> \n\n```\nfrom math import inf\n\nclass Solution:\n    def maxScoreSightseeingPair(self, values: List[int]) -> int:\n        \n        # The best value to the left of the array\n        left_best = values[0]\n        \n        # The current best value between the pairs\n        curr_best = -inf\n        \n        # Scan the values from index 1 onwards\n        for v in values[1:]:\n            \n            # Compare with current best and the distance\n            # betweent the best to the left of the current\n            # index. Here -1 added to the value giving\n            # a notion that distance increases by 1 on every\n            # index\n            curr_best = max(curr_best, left_best + v - 1)\n            \n            # The best to the left of the current index\n            # must be maintained to compute the current best\n            # value in the next iteration. Here also, -1\n            # is added to left best to make sure to increase\n            # distance from the left best for next index.\n            left_best = max(left_best - 1, v)\n            \n        return curr_best\n```\n\n> Soln 2: A slower but an understandable solution.\n> \n\n```\nfrom math import inf\n\nclass Solution:\n    \n    def maxScoreSightseeingPair(self, values: List[int]) -> int:\n        \n        # Init\n        best_dist = values[0]\n        prev_dist = -inf\n        dist = [best_dist]\n        \n        # Get the best distance to the left of \n        # the current index, start from index 1\n        for v in values[1:]:\n            \n            # Get best distance to the left of the\n            # currrent index\n            best_dist = max(prev_dist, best_dist-1)\n            \n            # Append best distance at current index\n            dist.append(best_dist)\n            \n            # Keep track of previous distance for next\n            # iteration\n            prev_dist = v - 1\n       \n        # Add the current value and the best\n        # distance from the current index and\n        # find the max score. Start from index 1.\n        max_score = -inf\n        for i,v in enumerate(values[1:],1):\n            max_score = max(max_score, v + dist[i])\n        \n        return max_score\n```
['Dynamic Programming', 'Python', 'Python3']