Easy java solution in hindi!!
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nval - varibale store ka
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nval - varibale store karega ki abhi tk left me max value kya possible hai \nagar apan ek element ko right shift karte rahe. Aise socho ki agar pehli value 8 hai array me aur agar apko use ek right le jana hai to uski value is now equivalent to 7 kyuki har baar right shift par ek value km hogi. Bs yahi major concept hai is question me. Fir ap compare karo ki apki jo new value hai wo us index ki value se badi hai ya choti.\n\nSimilar Question but isse thoda heavy {LC - 1937} - [https://leetcode.com/problems/maximum-number-of-points-with-cost/description/?envType=daily-question&envId=2024-08-17]()\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\n    public int maxScoreSightseeingPair(int[] values) {\n        int ans = 0;\n        int n = values.length;\n        int val = values[0];\n        for (int i = 1; i < n; i++) { \n            ans = Math.max(ans , values[i] + val-1);\n            val = Math.max(values[i] , val-1);\n        }\n        return ans;\n    }\n}\n```
['Dynamic Programming', 'Java']