int maxSubArray(int* nums, int numsSize) {

```
int table[numsSize][numsSize];
int i;
int j;
int k;
int max = -1e9;
if(numsSize == 1)return nums[0];
for(i = 0; i < numsSize; i++){
for(j = 0; j < numsSize; j++ ){
table[i][j] = 0;
if(i == j)table[i][j] = nums[i];
}
}
for(i = 1; i < numsSize; i++){
int sum = 0;
int len = 1+i;
for(j = 0; j <= numsSize-len; j++ ){
k = i+j;
table[j][k] = table[j][k-1] + table[j+1][k] - table[j+1][k-1];
}
}
return max;
```

}