"Не выполнены все требования задачи" ссылаясь на последнее условие, но всё работает. В чем я ошибаюсь
package com.javarush.task.task08.task0812;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Cамая длинная последовательность
*/
public class Solution {
public static void main(String[] args) throws IOException {
List<Integer> List = new ArrayList<>();
int read = 0;
int count = 1;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0; i < 10; i++)
{
List.add(Integer.parseInt(reader.readLine()));
}
for (int i = 0; i < List.size() - 1; i++)
{
if (List.get(i).equals(List.get(i+1)))
count++;
else {
if (count >= read)
{
read = count;
count = 1;
}
}
}
if (count >= read)
{
read = count;
}
System.out.println(read);
}
}