Company: Providence
Difficulty: medium
Count Pairs of Same Numbers Problem You are given an array arr of N integers. Two elements may be put together as a pair when they hold the same value, and every element belongs to at most one pair. Count the greatest number of such pairs that can be formed. If a value occurs an odd number of times, its last leftover occurrence stays unpaired. If no pair can be formed at all, print the exact text No pairs found . Read the input from STDIN and print the answer to STDOUT. Print nothing else - any extra text counts as output and fails the test. Complete the function solve , which receives N and arr and returns the line to print. Input Format The first line contains the integer N . The second line contains N space separated integers, the elements of arr . Output Format Print a single integer, the number of pairs, or the text No pairs found when that number is zero. Constraints 1 <= N <= 100000 1 <= arr[i] <= 10^9 Examples Example 1 Input: 11 6 1 6 5 1 2 8 2 9 2 4 Output: 3 6 an