```
class Solution(object):
def findMaxConsecutiveOnes(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
for i in range(len(nums))[:len(nums)-1]:
if nums[i]!=0 and nums[i+1]!=0: nums[i+1]=nums[i]+1
return max(nums)
```