Symmetric Pairs Hackerrank Solution