Simple C++ Solution || Commented
Please upvote if you like my solution .\n\nclass Solution {\npublic:\n    int maxScoreSightseeingPair(vector<int>& v) {\n        // to store best start site til
**Please upvote if you like my solution .**\n```\nclass Solution {\npublic:\n    int maxScoreSightseeingPair(vector<int>& v) {\n        // to store best start site till index i\n        vector<int> i(v.size());\n        i[0] = v[0] + 0;\n        // filling array\n        for(int x = 1; x<v.size();x++)\n            i[x] = max(i[x-1], v[x] + x);\n        int ans = 0;\n        // searching best macth with every end site\n        for(int x=1;x<v.size();x++)\n            if(ans < v[x] - x + i[x-1]) ans = v[x] - x + i[x-1];\n        return ans;\n    }\n};\n```
['Dynamic Programming', 'C']