No viable overloaded "="

Solution 1:

vector<int> maxSum[nums.size()];

This declares an array of vectors of integers. You can simply use parentheses to call the std::vector constructor indicating how many slots to pre-allocate and default-initialize.

vector<int> maxSum(nums.size());