unifpe
Distinct List in List of Lists
public class ListComparer : IEqualityComparer<List<long>>
{
public bool Equals(List<long> x, List<long> y)
{
if (x.Count != y.Count)
return false;
for (int i = 0; i < x.Count; i++)
if (x[i] != y[i]) return false;
return true;
}
public int GetHashCode(List<long> x) => x.Count;
}
6 replies