Skip to main content
Rollback to Revision 1
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6),  66  6566 bytes

s=>s.replace(o=/[a-z]+/gi,w=>o[s]>(o[n=w.length]=-~o[n])?0:s=n)|s&&s 

Try it online!Try it online!

JavaScript (ES6),  66  65 bytes

s=>s.replace(o=/[a-z]+/gi,w=>o[s]>(o[n=w.length]=-~o[n])?0:s=n)|s 

Try it online!

JavaScript (ES6), 66 bytes

s=>s.replace(o=/[a-z]+/gi,w=>o[s]>(o[n=w.length]=-~o[n])?0:s=n)&&s 

Try it online!

saved 1 byte
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 66 66  65 bytes

s=>s.replace(o=/[a-z]+/gi,w=>o[s]>(o[n=w.length]=-~o[n])?0:s=n)&&s|s 

Try it online!Try it online!

JavaScript (ES6), 66 bytes

s=>s.replace(o=/[a-z]+/gi,w=>o[s]>(o[n=w.length]=-~o[n])?0:s=n)&&s 

Try it online!

JavaScript (ES6),  66  65 bytes

s=>s.replace(o=/[a-z]+/gi,w=>o[s]>(o[n=w.length]=-~o[n])?0:s=n)|s 

Try it online!

Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 66 bytes

s=>s.replace(o=/[a-z]+/gi,w=>o[s]>(o[n=w.length]=-~o[n])?0:s=n)&&s 

Try it online!