Untitled
unknown
python
3 years ago
372 B
10
Indexable
user_input = input()
input_list = user_input.split()
m = int(input())
int_list = list(map(int,input_list))
ref = int(m)
longest = 0
current_longest = 1
for i in range(len(int_list)):
if int_list[i] == int(ref) or int_list[i] == int(ref) + int(m):
ref = int_list[i]
current_longest += 1
else:
print(longest)Editor is loading...