You are viewing a single comment's thread. Return to all comments →
Javascript using ES6:
function matchingStrings(stringList, queries) { return queries.reduce((acc, query) => { let occurrences = 0; stringList.forEach(string => { if (string === query) { occurrences++; } }); acc.push(occurrences); return acc; }, []); }
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 →
Javascript using ES6: