Sparse Arrays

  • + 0 comments

    My C# solution

     public static List<int> matchingStrings(List<string> strings, List<string> queries)
        {
            return queries.Select(q => 
                strings.Count(s => s == q))
                .ToList<int>();
        }