β back to unit
Medium
# puzzle gauntlet medium
Secret Santa Check
The Secret Santa list is out β but is it LEGAL? Every kid gives exactly one gift, every kid receives exactly one, and NOBODY gifts themselves. π
You get the kids and the assignments as giver:receiver pairs. Print valid or invalid.
Example:
Input: kids = ["mia", "leo", "kai"], assignments = ["mia:leo", "leo:kai", "kai:mia"]
Output: valid
Nobody gifts themselves, and each kid gives exactly once and receives exactly once β a perfect cycle.
π‘ need a hint?
pg-secret-santa.pyπ given lines are locked β write your code in between
loading...