Birthday Paradox

I understood the problem but my solution is not working when p=1 so what should I do?
https://ide.codingblocks.com/#/s/13094 This is the link to my solution.

When p = 1, you should handle this case explicitly.
It means you will need atleast 366 people to make sure that atleast 2 have birthday on the same day in a 365 day year. :smiley:

1 Like