You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to implement this one in Elixir, but I'm having trouble solving it, I think some cases may have issues.
"Direct parent-child relation" => degree 1, no problem
"Sibling relationship" => expected degree between siblings is 1, but from the description I expected it to be 2, with the path being: left child => parent => right child. Bypassing the parent for siblings is fine as a rule, but it should be explicit.
"Two degrees of separation, grandchild" => degree 2, no problem
"Unrelated individuals" => no problem
"Complex graph, cousins" => degree 4, but my solution gave degree 9. I did it by hand and I also get 9 (with the rule of siblings having a degree of separation 1, otherwise you would get 10)
"Complex graph, no shortcut, far removed nephew" => degree 15, but my solution fives me 14 (it could be 15 without the siblings rule potentially, I did not do this one by hand)
"Complex graph, some shortcuts, cross-down and cross-up, cousins three times removed" => degree 8, but my solution gives me no connection, and I confirmed by hand. Sofia doesn't have a parent, and she starts a second family with Qi in it.
Also in general, I like having large inputs, but only at the end when all base case have been covered. The cousin case, for example could be much smaller, it took me a long time to verify by hand.
I also noticed that the Elixir exercise generator does not preserve the ordering of the family tree entries, but with random order I never would have been able to check my solutions by hand, so maybe it's worth adding a comment saying that preserving the order would be a good idea.
The text was updated successfully, but these errors were encountered:
vaeng
changed the title
I've been trying to implement this one in Elixir, but I'm having trouble solving it, I think some cases may have issues.
fix: relative-distance corrections
Mar 7, 2025
Thank you for posting @jiegillet. I moved this to a new issue.
I was implementing this for C++ and had similar thoughts. I have to admit that I did not solve my solution programmatically and analyzed a mermaid graph I made by hand.
Don't use new uuids. It is very unlikely that maintainers have already implemented the exercise and it'll just be messy. Ping me to force merge the fix PR
@vaeng could you help me here?
Also in general, I like having large inputs, but only at the end when all base case have been covered. The cousin case, for example could be much smaller, it took me a long time to verify by hand.
I also noticed that the Elixir exercise generator does not preserve the ordering of the family tree entries, but with random order I never would have been able to check my solutions by hand, so maybe it's worth adding a comment saying that preserving the order would be a good idea.
Here is my tentative implementation.
Originally posted by @jiegillet in #2537 (comment)
The text was updated successfully, but these errors were encountered: