Untitled
Anonymous
python
04/27/2023 4:34 AM
496 B
25
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...