//我的思路,欢迎交流 class Solution { public: int maxSubArray(vector<int>& nums) { int sum = nums[0]; int MAX = nums[0]; for (int i = 1; i < nums.size(); i++) { sum = max(nums[i], sum + nums[i]); if (sum > MAX) MAX = sum; } return MAX; } int maxDarray(vector<int>& a)...