Duplicate and Nonduplicate Names X11956


Statement
 

pdf   zip

html

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
que tal?

como va la cosa.
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python