'''Assume we have list like this
[0,0,0,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1]
Basically a list of zero’s and one’s.
Write a python function to the number of maximum consecutive  one’s present in the array. 
output for the above array would be 4
'''


input_list=[0,0,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,0,1,0,0]
maxx=0
count=0
for i in range(len(input_list)):
    if input_list[i]==1:
        for j in range(i,len(input_list)):
            if (input_list[j]!=0):
                count=count+1
                if count>maxx:
                    maxx=count
            else:
                    count=0

print(maxx)  


0175c6da2b6f2ba24f9f7bf1db824aad02e86583
<mask token>

<mask token>
for i in range(len(input_list)):
    if input_list[i] == 1:
        for j in range(i, len(input_list)):
            if input_list[j] != 0:
                count = count + 1
                if count > maxx:
                    maxx = count
            else:
                count = 0
print(maxx)

<mask token>
input_list = [0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
    1, 0, 0]
maxx = 0
count = 0
for i in range(len(input_list)):
    if input_list[i] == 1:
        for j in range(i, len(input_list)):
            if input_list[j] != 0:
                count = count + 1
                if count > maxx:
                    maxx = count
            else:
                count = 0
print(maxx)

'''Assume we have list like this
[0,0,0,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1]
Basically a list of zero’s and one’s.
Write a python function to the number of maximum consecutive  one’s present in the array. 
output for the above array would be 4
'''


input_list=[0,0,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,0,1,0,0]
maxx=0
count=0
for i in range(len(input_list)):
    if input_list[i]==1:
        for j in range(i,len(input_list)):
            if (input_list[j]!=0):
                count=count+1
                if count>maxx:
                    maxx=count
            else:
                    count=0

print(maxx)  

