Code works when i run it but it is not verifying. Verify error says :Be sure that the length of the longest sequence is calculated correctly when it is located at the end of the list of entered numbers
package com.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
/*
Longest sequence
*/
public class Solution {
public static void main(String[] args) throws IOException {
int count = 1;
Scanner reader = new Scanner(System.in);
ArrayList<Integer> list = new ArrayList<>();
for (int i = 0; i < 10; i++) {
list.add(reader.nextInt());
}
for (int i = 0; i < list.size()-1; i++) {
if (list.get(i).equals(list.get(i+1))) count++;
}
//write your code here
System.out.println(count);
}
}