Skip to main content
golfed 3 points
Source Link
ETHproductions
  • 50.3k
  • 6
  • 96
  • 241

JavaScript (ES6), score 8181 78

Saved 3 points thanks to @Arnauld

s=>s.replace(d=/./g,z=>q+=d[z]=-~d[z],q=0)&&q

My original score-81 recursive solution:

f=([c,...s],d={})=>c?(d[c]=-~d[c])+f(s,d):0

81 can also be scored with a non-recursive solution:

s=>s.replace(d=/./g,c=>q+=d[c]=-~d[c],q=0)&&q

JavaScript (ES6), score 81

f=([c,...s],d={})=>c?(d[c]=-~d[c])+f(s,d):0

81 can also be scored with a non-recursive solution:

s=>s.replace(d=/./g,c=>q+=d[c]=-~d[c],q=0)&&q

JavaScript (ES6), score 81 78

Saved 3 points thanks to @Arnauld

s=>s.replace(d=/./g,z=>q+=d[z]=-~d[z],q=0)&&q

My original score-81 recursive solution:

f=([c,...s],d={})=>c?(d[c]=-~d[c])+f(s,d):0
added 48 characters in body
Source Link
ETHproductions
  • 50.3k
  • 6
  • 96
  • 241

JavaScript (ES6), score 81

f=([c,...s],d={})=>c?(d[c]=-~d[c])+f(s,d):0

There's probably81 can also be scored with a sneaky way to cut down on the score...non-recursive solution:

s=>s.replace(d=/./g,c=>q+=d[c]=-~d[c],q=0)&&q

JavaScript (ES6), score 81

f=([c,...s],d={})=>c?(d[c]=-~d[c])+f(s,d):0

There's probably a sneaky way to cut down on the score...

JavaScript (ES6), score 81

f=([c,...s],d={})=>c?(d[c]=-~d[c])+f(s,d):0

81 can also be scored with a non-recursive solution:

s=>s.replace(d=/./g,c=>q+=d[c]=-~d[c],q=0)&&q
Source Link
ETHproductions
  • 50.3k
  • 6
  • 96
  • 241

JavaScript (ES6), score 81

f=([c,...s],d={})=>c?(d[c]=-~d[c])+f(s,d):0

There's probably a sneaky way to cut down on the score...