Skip to content

Instantly share code, notes, and snippets.

@mloc
Created December 1, 2017 19:19
Show Gist options
  • Save mloc/df25a746417b14dbe6bc79e79b5ad4aa to your computer and use it in GitHub Desktop.
Save mloc/df25a746417b14dbe6bc79e79b5ad4aa to your computer and use it in GitHub Desktop.
s = open("d1.in", "r").read().strip()
count = 0
d = len(s) // 2
for i, c in enumerate(s):
if c == s[i - d]:
count += int(s[i - d])
print(count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment