JAVA SOLUTION || BRUTE FORCE
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int maximumSumSubsequence(int[] nums, int[][] queries) {\n        \n        long ans = 0;\n        \n        for(int i = 0; i < queries.length; i++) {\n            int pos = queries[i][0];\n            int x = queries[i][1];\n            \n            nums[pos] = x;\n            \n            long sum = task(nums);\n            \n            ans = (ans + sum) % 1000000007;\n        }\n        \n        return (int)ans;\n    }\n    \n    static long task(int[] nums) {\n        long prev2 = 0, prev = 0;\n        for(int i = 0; i < nums.length; i++){\n            long p = nums[i];\n            \n            p += prev2;\n\n            long curr = Math.max(p,prev);\n            prev2 = prev;\n            prev = curr;\n        }\n        return prev;\n    }\n}\n```
['Java']