Duplicate and Nonduplicate Names

Write a function @d@ that checks duplicate and nonduplicate given names
and family names in a list of people. Each person is provided by giving
their given name and their family name, together in a string. The
function must find which given names appear only once as such, and which
family names appear more than once as such.

Input

Input is a list of strings. Each string in the list has the given name
and the family name of a person, in this order, and separated by spaces.

Output

Your function must find the given names that appear only once as given
names, and the family names that appear more than once as family names.
It must return them in two ordered lists: first the ordered list of
nonduplicate given names and then the ordered list of duplicate family
names. Ordering must be according to the standard function @sorted@.

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T14:30:32.922Z

© Jutge.org, 2006–2026.
https://jutge.org
