using
System;
using
System.Linq;
using
System.Collections.Generic;
public
class
GFG {
public
static
int
get
(
int
n,
int
m, List<List<
int
>> v) {
HashSet<
int
> s =
new
HashSet<
int
>();
int
max_ans =
int
.MaxValue;
int
cnt = -1;
for
(
int
i = 0; i < n; i++) {
for
(
int
j = 0; j < m; j++) {
s.Add(v[i][j]);
}
int
size = (
int
) s.Count;
if
(cnt < size) {
size = cnt;
max_ans = Math.Min(max_ans, i);
}
s.Clear();
}
return
max_ans;
}
public
static
void
Main(String[] args) {
List<List<
int
>> arr =
new
List<List<
int
>>();
int
[] t1 = {1, 2, 3, 4, 5};
List<
int
> temp1 =
new
List<
int
>();
temp1 = (t1.ToList());
List<
int
> temp2 =
new
List<
int
>();
int
[]t2 = {1, 2, 2, 4, 7};
temp2 = (t2.ToList());
List<
int
> temp3 =
new
List<
int
>();
int
[] t3 = {1, 3, 1, 3, 1};
temp3 = t3.ToList();
arr.Add(temp1);
arr.Add(temp2);
arr.Add(temp3);
int
n = arr.Count;
int
m = arr[0].Count;
Console.Write(
get
(n, m, arr));
}
}