11# Instructions
22
33Your task is to determine the degree of separation between two individuals in a family tree.
4+ This is similar to the pop culture idea that every Hollywood actor is [ within six degrees of Kevin Bacon] [ six-bacons ] .
45
56- You will be given an input, with all parent names and their children.
67- Each name is unique, a child _ can_ have one or two parents.
@@ -13,22 +14,21 @@ Your task is to determine the degree of separation between two individuals in a
1314Given the following family tree:
1415
1516``` text
16- ┌──────────┐ ┌──────────┐ ┌───────────┐
17- │ Helena │ │ Erdős │ │ Shusaku │
18- └───┬───┬──┘ └─────┬────┘ └──────┬────┘
19- ┌───┘ └───────┐ └──────┬──────┘
20- ▼ ▼ ▼
21- ┌──────────┐ ┌────────┐ ┌──────────┐
22- │ Isla │ │ Tariq │ │ Kevin │
23- └────┬─────┘ └────┬───┘ └──────────┘
24- ▼ ▼
25- ┌─────────┐ ┌────────┐
17+ ┌──────────┐ ┌──────────┐ ┌───────────┐
18+ │ Helena │ │ Erdős ├─────┤ Shusaku │
19+ └───┬───┬──┘ └─────┬────┘ └────┬──────┘
20+ ┌───┘ └───────┐ └───────┬───────┘
21+ ┌─────┴────┐ ┌────┴───┐ ┌─────┴────┐
22+ │ Isla ├─────┤ Tariq │ │ Kevin │
23+ └────┬─────┘ └────┬───┘ └──────────┘
24+ │ │
25+ ┌────┴────┐ ┌────┴───┐
2626│ Uma │ │ Morphy │
2727└─────────┘ └────────┘
2828```
2929
30- The degree of separation between Tariq and Uma is 3 (Tariq → Helena → Isla → Uma).
31- There's no known relationship between Isla and [ Kevin] [ six-bacons ] , as there is no connection in the given data.
30+ The degree of separation between Tariq and Uma is 2 (Tariq → Isla → Uma).
31+ There's no known relationship between Isla and Kevin, as there is no connection in the given data.
3232The degree of separation between Uma and Isla is 1.
3333
3434~~~~ exercism/note
0 commit comments