LeetCode 674. 最长连续递增序列
class Solution {
public:
int findLengthOfLCIS(vector<int>& nums) {
int sz = (int)nums.size();
int rst = 0;
int cnt = 0;
for (int i = 0; i < sz; ++i) {
if (i && nums[i] > nums[i - 1]) {
++cnt;
} else {
cnt = 1;
}
rst = max(rst, cnt);
}
return rst;
}
};
解题思路:
难点1:就,,,跟着思路做就是了!