someone help me out pls
package com.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
/*
Longest sequence
*/
public class Solution {
public static void main(String[] args) throws IOException {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> lst = new ArrayList<>();
for(int i = 0; i < 10; i++){
lst.add(Integer.parseInt(reader.readLine()));//create a list of 10 numbers
}
int count = 0;//counter for the current length of the sequence of repeating nubmers;
int max_count = 0;//counter for the current max length of the sequence of repeating nubmers;
int num_repeated = lst.get(0);
for(Integer x : lst){
if(x == num_repeated){
count++;
}
else{
//if the number is different from the last number, change the repeated number to the current;
num_repeated = x;
if(max_count > count){
count = 1; //if the counter is smaller than the max, reset it to 1;
}
else{
max_count = count;//if the counter is smaller than the max, set max equal to the current counter and reset it to 1;
count = 1;
}
}
}
System.out.println(max_count);
}
}