Max Consecutive Ones python class Solution: def findMaxConsecutiveOnes(self, nums: List[int]) -> int: result = 0 a = [] for i in nums: if i == 1: result += 1 else: a.append(result) result = 0 a.append(result) return max(a) 1이 중복된 수를 리스트로 만들고 리스트중 최댓값 찾기 알고리즘/배열(array) 2023.06.26