Count how many pairs of elements have a sum equal to a given number k.: Hard Programming Problem