human
Solve in Python:
Given a binary array, find the maximum number of consecutive 1s in this array.

Example 1:

Input: [1,1,0,1,1,1]
Output: 3
Explanation: The first two digits or the last three digits are consecutive 1s.
    The maximum number of consecutive 1s is 3.


Note:

The input array will only contain 0 and 1.
The length of input array is a positive integer and will not exceed 10,000

=====
Give me a Python code to find the maximum number of consecutive 1s in this array?
assistant
#Here is Python code to find the maximum number of consecutive 1s in this array.

class Solution:
     def findMaxConsecutiveOnes(self, nums):
         """
         :type nums: List[int]
         :rtype: int
         """
         if nums == []:
             return 0
         
         count = 0
         countMax =0
         for ele in nums:
             if ele == 1:
                 count += 1
             else:
                 if count > countMax:
                     countMax = count
                 count = 0
         
         if count > countMax:
             countMax = count
         
         return countMax