Skip to content

Instantly share code, notes, and snippets.

@lufeihaidao
Created April 13, 2014 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lufeihaidao/10589458 to your computer and use it in GitHub Desktop.
Save lufeihaidao/10589458 to your computer and use it in GitHub Desktop.
Q10 of python challenge
from re import findall
def f(n):
return "1" if n == 0 else ''.join(
["%d%s"%(len(j)+1, i) for i,j in findall(r'(\d)(\1*)', f(n-1))])
print len(f(30))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment