using System.Collections.Generic;
public static void Main()
Dictionary<int, double[]> counts1 = new Dictionary<int,double[]>
{ 1, [27.1879476277225, 37.5134291710464, 73.6017562082174, 93.0498965871104, 90.6893190757005, 181.946376092798] },
{ 2, [27.1879476277225, 37.5134291710464, 73.6017562082174, 93.0498965871104, 90.6893190757005, 181.946376092798] },
{ 3, [-25, 54, -52, 25, 104, 48] },
var duplicateKeys = counts1.GroupBy(x => x.Value, new ArrayEqualityComparer<double>()).Where(x => x.Count()> 1).SelectMany(g => g).Select(i => i.Key);
var keysToRemove = counts1.Keys.Except(duplicateKeys).ToList();
foreach (int key in keysToRemove)
foreach (var pair in counts1)
Console.WriteLine("{0}: [{1}]", pair.Key, string.Join(", ", pair.Value));
public sealed class ArrayEqualityComparer<T> : IEqualityComparer<T[]>
private readonly IEqualityComparer<T> _elementComparer;
public ArrayEqualityComparer(IEqualityComparer<T> elementComparer)
_elementComparer = elementComparer ?? throw new ArgumentNullException(nameof(elementComparer));
public ArrayEqualityComparer()
_elementComparer = EqualityComparer<T>.Default;
public int GetHashCode(T[] obj)
if (obj is null || obj.Length == 0) return 0;
HashCode code = new HashCode();
for (int index = 0; index < obj.Length; index++)
code.Add(element, _elementComparer);
return code.ToHashCode();
public bool Equals(T[] x, T[] y)
if (x is null) return y is null;
if (y is null) return false;
if (x.Length != y.Length) return false;
for (int index = 0; index < x.Length; index++)
if (!_elementComparer.Equals(xElement, yElement))