Short Python Solution. Easy to Understand
class NumArray(object):\n\n    def init(self, nums):\n        """\n        :type nums: List[int]\n        """\n        self.nums = nums\n        self.sums = sum
class NumArray(object):\n\n    def __init__(self, nums):\n        """\n        :type nums: List[int]\n        """\n        self.nums = nums\n        self.sums = sum(nums)\n\t\t\n\t\t\n    def update(self, index, val):\n        """\n        :type index: int\n        :type val: int\n        :rtype: None\n        """\n        if val >= self.nums[index]:\n            self.sums += (val - self.nums[index])\n        else:\n            self.sums -= (self.nums[index] - val)\n        self.nums[index] = val\n        \n\n    def sumRange(self, left, right):\n        """\n        :type left: int\n        :type right: int\n        :rtype: int\n        """\n        left_sum = sum(self.nums[:left])\n        right_sum = sum(self.nums[right + 1:])\n        return self.sums - left_sum - right_sum
[]