This is a matching algorithm that creates pairs between two groups of people based on their preferences. matching(firsGroup, seconGroup) //each group is an object with string key and array value //returns [[a, b], [c, d], [e, f]]
matching(firstGroup, secondGroup) takes in two objects where each person or student lists the other groups people in order of who they prefer to work with.