Untitled

mail@pastecode.io avatar
unknown
python
a month ago
266 B
2
Indexable
Never
def largerPart(N, A):
    max_area = 0
    current_area = 0
    
    for i in range(N):
        if A[i] == 1:
            current_area += 1
            max_area = max(max_area, current_area)
        else:
            current_area = 0
            
    return max_area
Leave a Comment