Create a class AuntUncle that contains a method list which receives a
String[],
with each element containing a record of a person's birth - in
the form of "PARENT1 PARENT2 CHILD" (quotes for clarity only), and a
single String with the target person's name, and returns a
String[] of
all aunts and uncles for that target person, sorted alphabetically.
parents will contain between 1 and 50 elements, inclusive.
parents
will be in the form of "parent1 parent2 child" (quotes for
clarity).
parents
will not contain leading/trailing spaces.
parents
(parent1, parent2, and child) will contain only capital letters
('A'-'Z').
parents (parent1, parent2, and
child) will be separated by exactly one space.
parents
will not contain repeated names. That is,
parent1, parent2, and child will all be different names.
parents. In other
words, someone cannot be both a descendant and an ancestor of the same
person.
parents. A person can only have one pair of parents.
target will contain only capital letters ('A'-'Z').
target will be between 1 and 10 characters in length,
inclusive.
target will be contained as an item
(either parent1, parent2, or
child) in at least one element of parents.
parents = {"JOE JANE ROB"}
target = "ROB"
Returns: {}
Target "ROB"'s parents do not have parents, let alone siblings. "ROB"
has no uncles or aunts.
parents = {"JOE MARY FRANK", "BOB JANE MARTHA", "FRANK MARTHA ROB",
"BOB AMANDA TROY"}
target = "ROB"
Returns: {"TROY"}
Target "ROB"'s parent "MARTHA" has a parent "BOB" who has a child other
than either of "ROB"'s parents. This child is named "TROY", and must be
"ROB"'s Uncle (or Aunt).
parents = {"HECTOR DANA ROB", "ROB MARY JOE", "JOE MARY FRANK"}
target = "FRANK"
Returns:{}
Target "FRANK"'s parent "MARY" is also his parent "JOE"'s parent. Be careful
you don't think "FRANK" is his own Uncle (or Aunt).
parents = {"A B E", "C D F", "E F G", "A P Z", "B P Y", "C P X", "D P W",
"A B V", "B C U", "A C T", "B D S", "A D R", "B C Q"}
target = "G"
Returns: {"Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
Note that the answer is sorted alphabetically.