Birthday Paradox

I’m getting wrong answer for a few testcases

@aiman.mumtaz
There were couple of problems in your code

  1. if the p == 1, you need to print 366, so it requires separate if
  2. rounding of wont work you need as it’ll convert 36.6 to 37 but 36.2 to 36 but in either case answer should be
    37, thats why we will take sqrt in an integer and print that integer + 1
    I have edited your code accordingly, please take a look at it and ask if anything isn’t clear
    https://ide.codingblocks.com/s/204963

It’s working. Thanks a lot!!