short python code


  • 0
    A

    class Solution:
    def findMaxConsecutiveOnes(self, nums):

        s=''.join(str(x) for x in nums)
        return max([len(x) for x in s.split('0')])

Log in to reply
 

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