Created
February 21, 2021 04:24
-
-
Save theDreamer911/fcfbfe26929d0be8d173bafd7c483da0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wordMesh(arr){ | |
let r="" | |
for(let i=0;i<arr.length-1;i++){ | |
let t=(arr[i]+" "+arr[i+1]).match(/(.+) \1/) | |
if(!t) return "failed to mesh" | |
r+=t[1] | |
} | |
return r | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment