Faster than 98% | Python | No trees
\nclass NumArray:\n\n    def __init__(self, nums: List[int]):\n        self.nums = nums\n        self.s = sum(nums)\n        self.n = len(nums)\n\n    def updat
```\nclass NumArray:\n\n    def __init__(self, nums: List[int]):\n        self.nums = nums\n        self.s = sum(nums)\n        self.n = len(nums)\n\n    def update(self, index: int, val: int) -> None:\n        self.s = self.s-self.nums[index]+val\n        self.nums[index] = val\n        \n        \n\n    def sumRange(self, left: int, right: int) -> int:\n        #for some reason finding from both ends and removing it works.\n        #left\n        sL = sR = 0\n        for i in range(left):\n            sL+=self.nums[i]\n        for j in range(right+1,self.n):\n            sR+=self.nums[j]\n        return self.s-sL-sR\n```
['Python', 'Python3']