Solution to problem Pairs

The following is the solution to Hacker Rank problem Pairs
Algorithms>Search>Pairs