You are viewing a single comment's thread. Return to all comments →
Javascript
function processData(input) { const data = input.trim().split(/\n/); const lines = data.slice(1, parseInt(data[0]) + 1).join(' '); const words = data.slice(parseInt(data[0]) + 2, data.length); words.forEach(w => { const regex = new RegExp(`${w.slice(0, -2)}(?:ze|se)`, "g"); console.log((lines.match(regex) || []).length); }); }
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