[Java/Python] Descriptive solution.[O(N) Time | O(1) Space]. Very similar to Kadence Algo!
The goal is to keep track of:\n Maximum So far and add it to the cur_cell and maintain maximum result\n Here, max_so_far contains : A[i] + i\n\nOriginal Given F
*The goal is to keep track of:*\n* **Maximum So far** and add it to the cur_cell and maintain maximum result\n* Here, max_so_far contains : *A[i] + i*\n\n**Original Given Formula : A[i] + A[j] + i - j**\n* Break in two parts : ***A[i] + i***  and  ***A[j] -j***\n* Keep MAX_VALUE of first part among the elements seen so far\n* Add the current element to max_so_far and check the result is changing or not\n* Also, keep updating the max_so_far at each step\n\n**Java**\n```\nclass Solution {\n    public int maxScoreSightseeingPair(int[] a) {\n        int max_so_far = a[0];\n        int result = 0;\n        for(int i=1;i<a.length;i++){\n            result = Math.max(result, max_so_far + a[i] - i);\n            max_so_far = Math.max(max_so_far, a[i] + i);\n        }   \n        return result;\n    }\n}\n```\n\n**Python**\n```\nclass Solution:\n    def maxScoreSightseeingPair(self, a: List[int]) -> int:\n        max_so_far,result = a[0],0\n        \n        for i in range(1,len(a)):\n            result = max(result, max_so_far + a[i] - i)\n            max_so_far = max(max_so_far, a[i] + i)\n\t\t\t\n        return result\n```
[]