You are viewing a single comment's thread. Return to all comments →
Agree. not sure what this "medium" difficulty quesion is aiming at.
Shorter description: Given an array of strings FOO and a an array of strings BAR find the count of string in BAR that occurs in FOO.
C#. Linq is your friend.
var results = new int[queries.Length];
var index = 0; foreach (string s in queries) { results[index++] = strings.Where(i => i == s).Count(); } 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 →
Agree. not sure what this "medium" difficulty quesion is aiming at.
Shorter description: Given an array of strings FOO and a an array of strings BAR find the count of string in BAR that occurs in FOO.
C#. Linq is your friend.
var results = new int[queries.Length];