loading...

re: Daily Challenge #259 - Duplicate Encoder VIEW POST

TOP OF THREAD FULL DISCUSSION
re: A simple (and somewhat slow) JS solution: const encodeDuplicate = str => { //make a frequency map const freqMap = [...str.toLowerCase(...
 

Not that slow :) Better than anything that searched/scanned or did an indexOf for sure! You know I like that || 1 as well, I always do (acc[val] || 0) + 1 - but that is much neater. Borrowing that.

 
code of conduct - report abuse