You are viewing a single comment's thread. Return to all comments →
Deeeeeecent
const 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); for (const word of words) { const regex = new RegExp(`\\b${`${word.substring(0, word.length-2)}(ze|se)\\b`}`, 'g'); const result = lines.match(regex); console.log( result === null ? 0 : result.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 →
Deeeeeecent