Skip to content

Instantly share code, notes, and snippets.

@palcu
Last active December 29, 2015 11:49
Show Gist options
  • Save palcu/7666344 to your computer and use it in GitHub Desktop.
Save palcu/7666344 to your computer and use it in GitHub Desktop.
# sum up the portion of the matrix where the square
# should be
new_sum = 0
for line in range(sum_on_a_line):
if sum_on_a_line != sum(line[left : right]):
break
else:
new_sum += sum_on_a_line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment