Birthday pardox problem

Can you please explain this approach why in the code we have done (x > 1-p) .

@Mansi2103
we need to find the minimum no of days
so we initally assume min days to be 365
then we reduce it to the limit that until the condition x > 1- p is voilated
like what we are doing is
value of x should be reduced to the extent till it becomes that 1-p have different birthdays

like we are using negation rule
no of people such that p becomes 60% that 2 people have same birthday
P(Same) can be easily evaluated in terms of P(different) where P(different) is the probability that all of them have different birthday.
p(diff ) = 1 - P(same)

u could read this