Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pattern Recognition by ssk8
def checkio(pattern, image):
pattern_height, pattern_length = len(pattern), len(pattern[0])
for y in range(len(image) - pattern_height + 1):
for x in range(len(image[0]) - pattern_length + 1):
if pattern == [[image[i + y][j + x] for j in range(pattern_length)] for i in range(pattern_height)]:
for i in range(pattern_height):
for j in range(pattern_length):
image[i + y][j + x]+=2
return image
May 18, 2018