对Leetcode代码文件重命名

This commit is contained in:
huihut
2018-02-09 22:50:19 +08:00
parent 66ab312f9a
commit 12ac22f9a5
7 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#define MIN_INT -2147483648
class Solution {
public:
int maxSubArray(vector<int>& nums) {
int max = MIN_INT, temp = 0;
for(auto i = 0; i < nums.size(); ++i) {
temp += nums[i];
if(temp > max) max = temp;
if(temp < 0) temp = 0;
}
return max;
}
};