package pl.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
/*
Najdłuższa sekwencja
*/
public class Solution {
public static void main(String[] args) throws IOException {
//tutaj wpisz swój kod
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList<Integer>();
Integer count1 = 1;
Integer count2 = 1;
for (int i = 0; i < 10; i++) list.add(Integer.parseInt(reader.readLine()));
while (list.size() > 1)
{
if (list.get(1).equals(list.get(0)))
{
count2++;
}
else
{
if (count2 > count1) count1 = count2;
count2 = 1;
}
list.remove(0);
}
if (count2 > count1) count1 = count2;
System.out.println(count1);
}
}
package pl.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
/*
Najdłuższa sekwencja
*/
public class Solution {
public static void main(String[] args) throws IOException {
//tutaj wpisz swój kod
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList<Integer>();
Integer count1 = 1;
Integer count2 = 1;
for (int i = 0; i < 10; i++) list.add(Integer.parseInt(reader.readLine()));
while (list.size() > 1)
{
if (list.get(1).equals(list.get(0)))
{
count2++;
}
else
{
if (count2 > count1) count1 = count2;
count2 = 1;
}
list.remove(0);
}
if (count2 > count1) count1 = count2;
System.out.println(count1);
}
}