I don t know what but something is wrong, any hint? Tk you!
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 br = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList<>();
for(int i = 0; i < 10; i++){
int a = Integer.parseInt(br.readLine());
list.add(a);
}
int max = 1;
int count = 1;
for(int i = 0; i < list.size()-1; i++){
for(int j = i+1; j < list.size(); j++){
if(list.get(i) == list.get(j)){
count++;
if(count > max)
max = count;
}else {
count = 1;
}
}
}
System.out.println(max);
}
}