Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
template solution in Clear category for The Hidden Word by veky
def checkio(text, word):
import itertools
lines = text.replace(" ", "").lower().splitlines()
columns = map("".join, itertools.zip_longest(*lines, fillvalue=" "))
def scan(lines, reform):
for i, line in enumerate(lines, 1):
try: j = line.index(word.lower())
except ValueError: continue
return [(i, j + 1, j + len(word))[int(k)] for k in reform]
return scan(lines, "0102") or scan(columns, "1020")
Feb. 13, 2014
Comments: