• + 0 comments

    int sum = 0; int count= 0;

        for (int i = 0; i < ar.size(); i++)
        {
            for (int j = i + 1; j < ar.size(); j++)
            {
                sum = ar[i] + ar[j];
    
                if (sum % k == 0)
            {
                    count++;
                }
    
            }
        }
        return count;
    }