Ответ:
arr = [0, 0, 1, 5, 3, 9, 9, 9, 11] # Initial arrange
arr.append(None)
cnt = 1 # Counter
s = [] # List of amount of consecutive num.
for i in range(len(arr) - 1):
if arr[i] == arr[i + 1]:
cnt += 1
else:
s.append(cnt)
cnt = 1
print(max(s))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
arr = [0, 0, 1, 5, 3, 9, 9, 9, 11] # Initial arrange
arr.append(None)
cnt = 1 # Counter
s = [] # List of amount of consecutive num.
for i in range(len(arr) - 1):
if arr[i] == arr[i + 1]:
cnt += 1
else:
s.append(cnt)
cnt = 1
print(max(s))