The running time of my code is like 16ms, but it looks O(n) to me.

Can someone point me where I got wrong?

Thanks.

Here is my code:

```
public class Solution {
public int maxSubArray(int[] nums) {
int max = nums[0];
int lastSum = nums[0];
for (int i = 1; i < nums.length;i++) {
int cur = nums[i];
lastSum = Math.max(cur, cur + lastSum);
if (lastSum > max) max = lastSum;
}
return max;
}
```