Common Names


C# Arrays Public New

Easy 

10min


Implement the FindCommon method. When passed two arrays of names, it will return an array containing the names that appear in either or both arrays. The returned array should have no duplicates.

For example, calling Names.FindCommon(new string[]{'Ava', 'Emma', 'Olivia'}, new string[]{'Olivia', 'Sophia', 'Emma'}) should return an array containing Ava, Emma, Olivia, and Sophia in any order.

C# 7.0, .NET Framework 4.7
   

  •   Example case: System.NotImplementedException at Names.FindCommon(String[] names1, String[] names2) in CommonNames.cs:line 7
  •   Each array has distinct names: System.NotImplementedException at Names.FindCommon(String[] names1, String[] names2) in CommonNames.cs:line 7
  •   Each array has duplicate names: System.NotImplementedException at Names.FindCommon(String[] names1, String[] names2) in CommonNames.cs:line 7
  •   Arrays have some names in common: System.NotImplementedException at Names.FindCommon(String[] names1, String[] names2) in CommonNames.cs:line 7