Finding the possible number of equal pairs in an array
Based on the calculation of the number of pairs -your assertion is correct.
The whole calculation method could be simplified by:
    public static List&lt;KeyValuePair&lt;int,int&gt;&gt; solution(int[] A)
    {

        //n(n-1)/2 number of pairs by a given set
        return  A.GroupBy(x =&gt; x).ToList().
            Select(y =&gt; new KeyValuePair&lt;int, int&gt;((y.Count() * (y.Count() - 1)) / 2, y.Key)).ToList();
    }