Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
2 short versions solution in Creative category for The Hidden Word by StefanPochmann
# Version 1:
def checkio(t,w):
f=lambda:max((r.find(w)+1,i+1)for i,r in enumerate(m))
m=t.lower().replace(' ','').split('\n')
n=len(w)-1
j,i=f()
m=map(''.join,__import__('itertools').zip_longest(*m,fillvalue=' '))
I,J=f()
return j and[i,j,i,j+n]or[I,J,I+n,J]
# Version 2:
def checkio(t,w):
f=lambda m:max((''.join(r).find(w)+1,i+1)for i,r in enumerate(m))
m,n=t.lower().replace(' ','').split('\n'),len(w)-1
j,i,I,J=f(m)+f(__import__('itertools').zip_longest(*m,fillvalue=' '))
return j and[i,j,i,j+n]or[I,J,I+n,J]
April 15, 2015