JAVA || Clean & Concise & Optimal Code || Dynamic Programming Technique || O(N) Time Solution
\nclass Solution {\n    public int maxScoreSightseeingPair(int[] values) {\n        \n        int best = values[0], maxScore = 0;\n        \n        for (int i 
```\nclass Solution {\n    public int maxScoreSightseeingPair(int[] values) {\n        \n        int best = values[0], maxScore = 0;\n        \n        for (int i = 1; i < values.length; i++) {\n            maxScore = Math.max (maxScore, values[i] + best - i);\n            best = Math.max (best, values[i] + i);\n        }\n        \n        return maxScore;\n    }\n}\n```\n\nPlease help to **UPVOTE** if this post is useful for you.\nIf you have any questions, feel free to comment below.\n\n**LOVE CODING :)\nHAPPY CODING :)\nHAPPY LEARNING :)**
[]