// this is a very bad solution, in this problem we do not need to use dynamic memory, because std::vector automatically uses dynamic memory internally. // the solution below therefore is just a demonstration of how to use the new and delete operator. class Solution { public: vector runningSum(vector& nums) { int sum=0; vector result; int size = nums.size(); // because runningSum will have size elements, and runningSum[0] is the sum of one element, i.e., nums[0]. for(int i=1;i<(size+1);i++){ int *a = new int[i]; // sum stores the sum from nums[0] to nums[i] for(int j=0;j