hackerrank pairs problem