The problem is not challenging, so make the solution as short as possible.

```
class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int m=0, r=0; // m is max
for(int n:nums) n?m=max(++r,m):r=0;
return m;
}
};
```