@@ -0,0 +1,2100 @@
+import java.util.*;%0A%0Apublic class Siblings %7B%0A%0A  public static void findSiblings(String parentSibling)%0A  %7B %0A    List%3CString%3E input = Arrays.asList(parentSibling.split(%22,%22));%0A    String person = input.get(input.size()-1);%0A    HashMap%3CString, String%3E dictMap = new HashMap%3CString, String%3E();%0A%0A    for (int i = 0; i %3C input.size()-1; i++)%0A    %7B%0A      String%5B%5D pair = input.get(i).split(%22-%3E%22); // ex. %5BFrank, Mary%5D%0A       %0A       %0A      // if a parent/offspring relationship does not exist, create one%0A      if (!dictMap.containsKey(pair%5B0%5D))%0A      %7B%0A          dictMap.put(pair%5B0%5D, pair%5B1%5D);%0A      %7D%0A      // else, add on to the existing relationship%0A      else%0A      %7B%0A          // since it is possible to concaticate strings, we dont not have to %0A          // use a HashMap%3CString, ArrayList%3E%0A          dictMap.put(pair%5B0%5D, pair%5B1%5D + %22,%22 + dictMap.get(pair%5B0%5D));%0A      %7D%0A    %7D%0A%0A    for (String parent : dictMap.keySet())%0A    %7B%0A      // iterate through the parent/sibling hashmap until it finds one containing the person we are looking for%0A      if (dictMap.get(parent).contains(person))%0A      %7B%0A        // if the value only contains a single entry, then that person is an only child%0A        if (Arrays.asList(dictMap.get(parent).split(%22,%22)).size() == 1)%0A        %7B%0A          System.out.println(person + %22 has no siblings%22);%0A        %7D%0A        else%0A          // else print the siblings of the person%0A        %7B%0A          System.out.print(person + %22's siblings are: %22);%0A          for (String s : Arrays.asList(dictMap.get(parent).split(%22,%22)))%0A          %7B%0A            if (!s.equals(person))%0A            %7B%0A              System.out.print(s + %22 %22);%0A            %7D%0A          %7D%0A          System.out.println(%22%22);%0A        %7D%0A      %7D%0A    %7D%0A  %7D%0A  public static void main(String%5B%5D args)%0A  %7B%0A    String testString1 = %22Bob-%3EFrank,Sally-%3EBob,Bob-%3EJoe,Joe-%3EChris,Joe-%3EFred,Bob%22;%0A    String testString2 = %22Bob-%3EBrank,Bob-%3ESally,Joe-%3EFred,Joe-%3EChris,Joe-%3EPat,Chris%22;%0A%0A    // tests%0A    findSiblings(testString1); // prints %22Bob has no siblings%22%0A    findSiblings(testString2); // prints %22Chris's siblings are: Pat Fred %22%0A%0A  %7D%0A%7D%0A%0A

Create Sibling.java