Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Hidden Word by juestr
from itertools import zip_longest
def checkio(text, word):
lines = [l.replace(' ', '').lower() for l in text.splitlines()]
for r, l in enumerate(lines):
c = l.find(word)
if c != -1:
return [r+1, c+1, r+1, c+len(word)]
transposed = (''.join(l) for l in zip_longest(*lines, fillvalue=' '))
for c, l in enumerate(transposed):
r = l.find(word)
if r != -1:
return [r+1, c+1, r+len(word), c+1]
return None
May 13, 2019
Comments: