class NumArray {
private:
vector<int> num;
public:
NumArray(vector<int>& nums) {
num=nums;
}
int sumRange(int i, int j) {
return accumulate(num.begin()+i, num.begin()+j+1,0);
}
};
/**
* Your NumArray object will be instantiated and called as such:
* NumArray* obj = new NumArray(nums);
* int param_1 = obj->sumRange(i,j);
*/