Friends Pairing Problem

Not sure what is wrong with the code!