You are viewing a single comment's thread. Return to all comments →
Javascript:
const lines = input.split(/^\d+\s(?=.*$)/gm); const words = lines[2].split("\n"); words.forEach((word) => { const regex = new RegExp(`(?<!\\b)${word}(?!\\b)`, 'g'); const sum = lines[1].match(regex)?.length || 0; console.log(sum); });
Seems like cookies are disabled on this browser, please enable them to open this website
Find A Sub-Word
You are viewing a single comment's thread. Return to all comments →
Javascript: