one test case failed for birthday Paradox problem
One test case failed for birthday Paradox problem
import java.util.*; public class Main { public static void main(String args[]) { Scanner scn = new Scanner(System.in); double p = scn.nextDouble(); System.out.println((int)Math.ceil(Math.sqrt(2 * 365 * Math.log(1 / (1 - p))))); } }
Please send your code link. Don’t paste raw code.
Also make sure your code work for corner cases like p = 0, p =1;
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.