Cristi BALAN wrote: > The solution does the following: > - groups persons by family, > - orders the families descending by number of members > - gets a santa as a member from the family with the most number of members > - for this santa, finds a santee as a member from the family with the > mose number of members, that is not the santa's family > rinse, repeat until there are no more santas and all is ok or, until > we can't find a santee for a santa and decide we can't hook these > people up This is similar to the approach I took, except that my program ends up with a circular list where each person gives to the next in the list, while yours comes up with discrete santa/santee pairs. I think the two ways probably work equally well...