The mentor recommendation is: "Be sure that the program works correctly if the sequence consists of numbers greater than 127.".
I checked and indeed it doesn't work for bigger numbers but I have no idea why not.
Please help
p.s. I've got rid of line 24
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> list = new ArrayList<Integer>();
for(int a = 0; a < 10; a++){
list.add(Integer.parseInt(reader.readLine()));
}
int count = 1;
int maxCount = 1;
for(int b = 0; b<list.size()-1; b++){
int x = list.get(b);
if(list.get(b) == list.get(b+1)){
count++;
if(count > maxCount){
maxCount = count;
}
}
else {
count = 1;
}
}
System.out.println(maxCount);
}
}