Created
April 19, 2017 13:40
-
-
Save slofurno/951559bbc266790cd5b7838eb4b133ad to your computer and use it in GitHub Desktop.
This file contains 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 counts(n) { | |
var s = '1' | |
for(var i = 0; i < n; i++) { | |
s = s.match(/(\d)(\1)*/g).map(x => x.length + x[0]).join('') | |
} | |
return s | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment