Skip to content

Instantly share code, notes, and snippets.

Created July 2, 2018 16:20
What would you like to do?
def ex8(window_size):
large_number = open("source.txt", 'r').read()
max_product = 1
for i in range(0, len(large_number)):
product = 1
if i + window_size <= len(large_number):
for j in range(i, i + window_size):
product *= int(large_number[j])
max_product = max(max_product, product)
return max_product
assert ex8(4) == 5832
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment