You are viewing a single comment's thread. Return to all comments →
C# Linq Solution
public static List<int> matchingStrings(List<string> stringList, List<string> queries) { List<int> results = new List<int>(); foreach(string query in queries) { results.Add( stringList.Contains(query) ? stringList.Count(x => x == query) : 0 ); } return results; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
C# Linq Solution