PLEASE HELP ME WHY THIS IS TLE ????????????
\n\n# Code\n\nclass Solution {\nint mod=(int)(1e9+7);\n    public int maximumSumSubsequence(int[] a, int[][] q) {\n        long ans=0;\n        for(int i=0;i<q.
\n\n# Code\n```\nclass Solution {\nint mod=(int)(1e9+7);\n    public int maximumSumSubsequence(int[] a, int[][] q) {\n        long ans=0;\n        for(int i=0;i<q.length;i++){\n            a[q[i][0]]=q[i][1];\n            long pre[]=new long[2];\n            pre[0]=a[0];\n            for(int j=1;j<a.length;j++){\n                long cur[]=new long[2];\n                for(int fl=0;fl<=1;fl++){\n                    long take=0,notake=0;\n                    if(fl==0)\n                    take=(pre[1]+a[j])%mod;\n                    notake=pre[0];\n                    cur[fl]=Math.max(take,notake)%mod;\n                   \n                }\n                 pre=cur;\n            }\n            long tot=0;\n            tot=Math.max(tot,Math.max(pre[0],pre[1]));\n            \n            \n            ans=(ans+tot)%mod;\n        }\n        return (int)ans;\n    }\n   \n}\n```
['Java']