This is my current solution. Any better search algorithms?
public void membersOfBothGroup(string groupA,string groupB)
{
List usersInGroupA = getGroupMembers(groupA);
List usersInGroupB = getGroupMembers(groupB);
List userInBothAB = new List();
foreach (string userA in usersInGroupA)
{
foreach(string userB in usersInGroupB)
{
if (userA == userB)
{
userInBothAB.Add(userA);
}
}
}
}
Here’s an example (since the datatype is
string):Output: