C++ || Easy Solution
\nclass NumArray {\npublic:\n    vector<int>v; \n    int sum;\n    NumArray(vector<int>& nums) {\n        v=nums;\n        sum=0;\n        for(int i=0;i<nums.si
```\nclass NumArray {\npublic:\n    vector<int>v; \n    int sum;\n    NumArray(vector<int>& nums) {\n        v=nums;\n        sum=0;\n        for(int i=0;i<nums.size();i++){\n            sum+=nums[i];\n        }\n    }   \n    void update(int index, int val) {\n        sum-=v[index];\n        v[index]=val;\n        sum+=val;      \n    } \n    int sumRange(int left, int right) {\n        int res=sum; \n        for(int i=0;i<left;i++){ \n            res-=v[i];\n        }\n        for(int i=right+1;i<v.size();i++){\n            res-=v[i];\n        }\n        return res;\n    }\n};\n```
['C']