```
from itertools import groupby
class Solution(object):
def findMaxConsecutiveOnes(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
ones = [len(x) for x in filter(lambda x: x[0] ==1, [list(g) for i,g in groupby(nums)])]
if ones:
return reduce(lambda x,y: max(x,y), ones)
else:
return 0
```