Hi, my code kept failing the get_cousin_dist() part.
it is passing the tests until (B, D).
From what i understood, to find the degree value of 2 individuals, I have to find the generation distance between their common ancestor and the originator.
For example:
the pair D and E
they have the common ancestor B, and the generation distance between B and Originator A is 0. So the degree value is 0.
And if their common ancestor is the Originator itself, then take the larger distance as the degree.
For example:
the pair B and F
the generation distance from B to A is 0, and the distance from F to A is 1, so the degree value is 1.
But for the pair B and D, B itself is the ancestor of D, the pair's expected degree value is 0.
Clearly the "B to A is 0, D to A is 1, so take 1" method isn't working here.
So I thought, then B itself would be their common ancestor?
B to A is 0, and the expected value is 0, it seems to be working.
But then there's the pair B and J, their expected degree value is 1.
B is also the ancestor of J.
B to A is 0, J to A is 2, but the expected value isn't 2.
And going with b is the common ancestor, the expected value isn't 0 either.
So I am genuinely confused on why the expected degree value of (B, D) is 0, and for (B, J) is 1.