Why is it prompted that I cannot be greater than 128? Please some help.....
package zh.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
/*
最长序列
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));//在此编写你的代码
ArrayList<Integer> al=new ArrayList<Integer>();
for(int i=0;i<10;i++){
al.add(Integer.parseInt(br.readLine()));
}
ArrayList<Integer> count=new ArrayList<Integer>();
for(int i=0;i<10;i++) {
count.add(1);
}
int index=0;
for(int i=0;i<al.size()-1;i++){
if(al.get(i)==al.get(i+1)){
count.set(index,count.get(index)+1);
}else{
index++;
count.set(index,1);
}
}
int max=count.get(0);
for(int i=0;i<count.size();i++){
if(count.get(i)>max){
max=count.get(i);
}
}
System.out.println(max);
}
}