You are given a list of people, and you must divide them into as many groups as possible. Each person must belong to exactly one group, and each group must contain one or more people. Friends must not be split apart, so if two people are friends, they must be in the same group.
You will be given a String names, each element of which is the name of a single person. You will also be given a String friends, each element of which is formatted as "<name1> <name2>" (quotes for clarity only), meaning that <name1> and <name2> are friends. Each <name1> and <name2> will exist in names. Return the maximum number of groups that can be formed.