Python One line solution


  • 0
    Y

    class Solution(object):
    def findMaxConsecutiveOnes(self, nums):
    """
    :type nums: List[int]
    :rtype: int
    """
    return max([len(i) for i in ''.join(map(str,nums)).split('0')])


Log in to reply
 

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