Brute Force, dynamic programming, java solution
Approach\nThis is based on house robber problem so solve that first.\n\n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity:O(Q 
# Approach\n**This is based on house robber problem so solve that first.**\n\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(Q * N).\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public static int helper(int[] nums) {\n        if (nums.length == 0) {\n            return 0;\n        }\n        if (nums.length == 1) {\n            return nums[0];\n        }\n        int[] dp = new int[nums.length];\n        dp[0] = nums[0];\n        dp[1] = Math.max(nums[0], nums[1]);\n        for (int i = 2; i < nums.length; i++) {\n            dp[i] = Math.max(nums[i], Math.max(dp[i - 1], dp[i - 2] + nums[i]));\n        }\n        return dp[nums.length - 1];\n    }\n\n    public int maximumSumSubsequence(int[] nums, int[][] queries) {\n        long sum = 0;\n        for (int[] temp : queries) {\n            int x = temp[0];\n            int y = temp[1];\n            nums[x] = y;\n            int t = helper(nums);\n            if (t <= 0)\n                t = 0;\n            sum += t;\n        }\n        sum = sum % 1000000007;\n        return (int)sum;\n    }\n}\n\n```
['Java']