Skip to content

Instantly share code, notes, and snippets.

@Elyx0
Created August 26, 2015 04:21
Show Gist options
  • Save Elyx0/880b59843b521de20acc to your computer and use it in GitHub Desktop.
Save Elyx0/880b59843b521de20acc to your computer and use it in GitHub Desktop.
(a,b) => {
var h = a.length > b.length ? a : b;
var l = h==a ? b.split('') : a.split('');
return h.split('').reduce((x,y,i)=> {
return y == l[i] ? ++x: x;
},0) / h.length;
}("boat","coat")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment