This function shortens a list of names by removing the last names,
but only if the first name is unique in the list. If the first name
is not unique, the full name is returned.
Parameters
names: string[]
An array of full names (first and last name)
Returns string[]
An array of names where each name is either a first name (if unique) or a full name
This function shortens a list of names by removing the last names, but only if the first name is unique in the list. If the first name is not unique, the full name is returned.