Hallo an alle, die letzte Bedingung wird angeblich nicht erfüllt. Kann jemand mit sagen, was da falsch ist?
package de.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
/*
Längste Sequenz
*/
public class Solution {
public static void main(String[] args) throws IOException {
//schreib hier deinen Code
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList<Integer>();
int counter = 1;
int anzahl = 0;
for(int i = 0; i < 10; i++){
int a = Integer.parseInt(reader.readLine());
list.add(a);
}
for(int i = 1; i < 10; i++){
if(list.get(i) == list.get(i-1)){
counter++;
if(anzahl < counter){
anzahl = counter;
}
}
else{
counter = 1;
}
}
System.out.println(anzahl);
}
}