C
C#6mo ago
unifpe

Distinct List in List of Lists

1,1].Distinct() returns [1] [[1],[1]].Distinct() returns [[1],[1]] what to do ?
2 Replies
unifpe
unifpeOP6mo ago
I need this only for numeric values 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; } How to do this for generic real number type using numeric types ?
Want results from more Discord servers?
Add your server