Codington
0 of 6 problems solved • 0%

Exercise prompt

Compare the Guest Lists

Set difference is directional: invited minus arrived and arrived minus invited answer two different questions.

Example

A gardener checks which seeds still need to be planted.

planned = {"peas", "beans", "mint"} planted = {"mint", "basil"} print(sorted(planned - planted)) # ['beans', 'peas']

The left set supplies the candidates and the right set removes matches. Swapping them answers a different question.

Your task

Return a tuple of two sorted lists: invited names who are absent, then arrivals who were not invited. Duplicate names count only once.

guest_changes(["Bo", "Al"], ["Al", "Jo"]) # (["Bo"], ["Jo"])