[Community Puzzle] orDer oF succeSsion

I didn’t find a topic for this puzzle https://www.codingame.com/training/easy/order-of-succession, I’m not sure if I was supposed to create one or not.

I can’t seem to figure out how to solve this one. The title strongly hints about using a DFS algorithm, but DFS doesn’t account for ordering the children of a certain person as it is asked here.

Any hints? (I’m working in C++ btw)

Yes, the trick is to sort the children when you add them in the queue.

Hi all, I just finished solving the puzzle about the British Family Succession list, but I noticed that the cases mentioned did not include we we have twins

Test case
3
Elizabeth - 1926 - Anglican F
Charles Elizabeth 1948 - Anglican M
William Elizabeth 1948 - Anglican M

What is the rule when we have twin brothers as candidates ?

The first born of them both is the first born, I guess.

Thanks for the answer, but in the input they appear at the same year because they are twin, how can we order them ?

1 Like