solution for BirthdayParadox