Skip to content

Commit ad7e332

Browse files
authored
fix: relative distance (#2545)
* fix: relative distance * add clarification on relationship rules * fix: implement comments
1 parent 881373b commit ad7e332

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

exercises/relative-distance/canonical-data.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"personA": "Dimitri",
122122
"personB": "Fabio"
123123
},
124-
"expected": 4
124+
"expected": 9
125125
},
126126
{
127127
"uuid": "2cc2e76b-013a-433c-9486-1dbe29bf06e5",
@@ -185,25 +185,24 @@
185185
"personA": "Lucia",
186186
"personB": "Jun"
187187
},
188-
"expected": 15
188+
"expected": 14
189189
},
190190
{
191191
"uuid": "46c9fbcb-e464-455f-a718-049ea3c7400a",
192-
"description": "Complex graph, some shortcuts, cross-down and cross-up, cousins three times removed",
192+
"description": "Complex graph, some shortcuts, cross-down and cross-up, cousins several times removed, with unrelated family tree",
193193
"property": "degreeOfSeparation",
194194
"input": {
195195
"familyTree": {
196196
"Aiko": ["Bao", "Carlos"],
197-
"Bao": ["Dalia", "Elias"],
197+
"Bao": ["Dalia"],
198198
"Carlos": ["Fatima", "Gustavo"],
199199
"Dalia": ["Hassan", "Isla"],
200-
"Elias": ["Javier"],
201200
"Fatima": ["Khadija", "Liam"],
202201
"Gustavo": ["Mina"],
203202
"Hassan": ["Noah", "Olga"],
204203
"Isla": ["Pedro"],
205204
"Javier": ["Quynh", "Ravi"],
206-
"Khadija": ["Viktor"],
205+
"Khadija": ["Sofia"],
207206
"Liam": ["Tariq", "Uma"],
208207
"Mina": ["Viktor", "Wang"],
209208
"Noah": ["Xiomara"],
@@ -246,10 +245,10 @@
246245
"Yassin": ["Lucia"],
247246
"Zara": ["Mohammed"]
248247
},
249-
"personA": "Tomoko",
250-
"personB": "Qi"
248+
"personA": "Wyatt",
249+
"personB": "Xia"
251250
},
252-
"expected": 8
251+
"expected": 12
253252
}
254253
]
255254
}

exercises/relative-distance/instructions.md

+5
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ The degree of separation between Tariq and Uma is 3 (Tariq → Helena → Isla
3131
There's no known relationship between Isla and [Kevin][six-bacons], as there is no connection in the given data.
3232
The degree of separation between Uma and Isla is 1.
3333

34+
~~~~exercism/note
35+
Isla and Tariq are siblings and have a separation of 1.
36+
Similarly, this implementation would report a separation of 2 from you to your father's brother.
37+
~~~~
38+
3439
[six-bacons]: https://en.m.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon

0 commit comments

Comments
 (0)