I would love to help you with this question, but I just can't seem to make sense out of it. I think you've worded the question incorrectly? Two people meet each-other, right? How many ways can two people shake hands? Unless you are talking about secret handshakes and such, of which there would be an infinite number, I can't see a total of more than 3 ways that make sense: right to right/left to left, are both hands at once. But that's only 3 ways, not anywhere near 20, 25, 40, or 45...
If it is not a comfortable handshake, you could do r/r r/l l/l l/r and all 4 at once, but even that is just 5.
It has the making of a joke and not a true math puzzle. I would suspect some kind of punch-line if you hadn't given only 4 possible answers.