little cheating with python


  • 0
    S
    class Solution(object):
        def findMaxConsecutiveOnes(self, nums):
            """
            :type nums: List[int]
            :rtype: int
            """
            l = ''.join([str(n) for n in nums]).split('0')
            return len(max(l, key=len))
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.