package com.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
/*
Longest sequence
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> n = new ArrayList<>();
ArrayList<Integer> l = new ArrayList<>();
for(int i = 0 ; i < 10 ; i++)
{
Integer k = Integer.parseInt(reader.readLine());
n.add(k);
}
for(int i = 0 ; i < 10 ; i++)
{
int count = 0;
for(int j = 0 ; j < 10; j++)
{
if(i == j) continue;
if(n.get(i).equals(n.get(j)))
{
count++;
}
}
l.add(i,count);
}
System.out.println(Collections.max(l));//write your code here
}
}
package com.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
/*
Longest sequence
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> n = new ArrayList<>();
ArrayList<Integer> l = new ArrayList<>();
for(int i = 0 ; i < 10 ; i++)
{
Integer k = Integer.parseInt(reader.readLine());
n.add(k);
}
for(int i = 0 ; i < 10 ; i++)
{
int count = 0;
for(int j = 0 ; j < 10; j++)
{
if(i == j) continue;
if(n.get(i).equals(n.get(j)))
{
count++;
}
}
l.add(i,count);
}
System.out.println(Collections.max(l));//write your code here
}
}