int max(int a,int b){return a>b?a:b;}
int maxSubArray(int* nums, int numsSize) {
int dp[1001];
dp[0]=0;
for(int i = 1;i <= numsSize;i){
dp[i]=max(nums[i-1],nums[i-1]+dp[i-1]);
}
int maxNum = -200000;
for(int i = 1;i<=numsSize;i){
maxNum=max(maxNum,dp[i]);
}
return maxNum;
}