You are viewing a single comment's thread. Return to all comments →
Javascript solution:
const lines = input.split(/^\d+\s*$/gm); const words = lines[2].trim().split("\n"); words.forEach((word) => { const regex = new RegExp(`\\b(${word}|${word.replace(/ze$/, 'se')})\\b`, 'gmi'); const total = lines[1].match(regex)?.length || 0; console.log(total); });
Seems like cookies are disabled on this browser, please enable them to open this website
The British and American Style of Spelling
You are viewing a single comment's thread. Return to all comments →
Javascript solution: