def __init__(self, nums):
        """
        initialize your data structure here.
        :type nums: List[int]
        """
        self.res = [0] * (len(nums) + 1)
        self.data = list(nums)
        for i in range(len(self.data)):
            self.res[i + 1] = self.res[i] + nums[i]

        initialize your data structure here.
        :type nums: List[int]
        
python/303_Range_Sum_Query_Immutable.py