interviewalgo 21-03, Array, LeetCode 2021-05-16 Source Edit History 485. 最大连续 1 的个数 IntroductionQuestion:485. 最大连续 1 的个数 Analysis简单的遍历就好了。。。太简单了,没啥好说的。 Implement1234567891011121314int findMaxConsecutiveOnes(vector<int>& nums) { // 只包含 0 和 1 int res, c; res = c = 0; for(auto &i: nums) { if (i == 0) { res = max(res, c); c = 0; } else c++; } res = max(res,c); return res;} One More Thing