AAutodesk·DSASDE-1Technical Phone Screen
Secret Santa Assignment
Problem
Given a list of people, return a random Giver -> Receiver map where no one is assigned to themselves; part 2 adds 'person A cannot pick B' restrictions.
Example
[A,B,C] -> {A:B, B:C, C:A}
Constraints
- No self-assignment; respect forbidden pairs
Approach
Derangement via shuffle-and-validate, or bipartite matching when restrictions are added. Reported Autodesk question.
added 6 days ago