DEV Community

Discussion on: Daily Challenge #244 - Search for Letters

Collapse
 
miketalbot profile image
Mike Talbot ⭐ • Edited

This is a one statement in JS that works:

    (input)=>input.match(/[a-zA-Z]/g)
        .reduce((c,a)=>(c[(a.charCodeAt(0) & 31) -1]='1',c), 
           Array.from('0'.repeat(26)))
       .join('')