Seemingly incorrect analytical solution to Problem 4 of Birthday Lab

My approach:
In order to let students in B classroom to have a match with students from A, supposing the n students take n slots in 365 days, each student from B has probability of (n/365) to have a match with A students. We can have the probability that every B student has a match with A students, which is (n/365)^n. Therefore, the final answer to “find a match between a student in one classroom and a student in the other” should be 1-(n/365)^n.

I guess you assume that any two students in group A don’t have the same birthday and this also applies to B. This assumption makes sense and clarifies Problem 4, although there seems to be an error in your subsequent calculation (correct me if I’m wrong).
My calculation is: the probability that student 1 in group B doesn’t match with anyone in group A is (1 - n/365), the probability that student 2 in group B doesn’t match with anyone in group A is also (1 - n/365), and so on. So the probability that there is no match between A and B would be (1 - n/365)^n. Applying the complement rule the probability that there is at least one match between A and B is 1 - (1 - n/365)^n.