I have an array, containing n
amount of elements. Each element contains two words.
This makes the array look like this: ['England John', 'England Ben', 'USA Paul', 'England John']
I want to find the number of unique names for each country. For example, England
would have 2 unique names as John
exists two times.
So far I have split the array into two arrays, one containing the countries such as ['England', 'Usa', ...]
and the other containing names ['John', 'Paul', ...]
, however I'm unsure of where to go from here