I've tested it with the longest sequence in the front, in the middle and on the end...all good results. Tested it with all the same input with result 10, tested it with all unique values with result 1. Suggestions????
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 {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> intList = new ArrayList<>();
int count = 1;
int max = 1;
for (int i = 0; i < 10; i++)
intList.add(Integer.parseInt(reader.readLine()));
for (int i = 0; i < intList.size() - 1; i++) {
if (intList.get(i).equals(intList.get(i + 1))) {
count++;
}
else if (count > max) {
max = count;
count = 1;
}
}
if (count > max)
max = count;
System.out.println(max);
}
}