-
-
Save williame/77fbf6ff13d6ea0261fb 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
def s(h,n): | |
l=h.find('\n')+2;h+='\n'*l;L=len(h);i=L*8 | |
while i: | |
i-=1;j=i;m=len(n) | |
for c in n:m-=c==h[j%L];j+=[-l,1-l,2-l,-1,1,l-2,l-1,l][i/L] | |
if m<1:return 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment