Skip to content

Instantly share code, notes, and snippets.

@kaathewise
Last active December 20, 2021 23:29
Show Gist options
  • Save kaathewise/903adbab6d61dbde3a7ca5b41c601f7b to your computer and use it in GitHub Desktop.
Save kaathewise/903adbab6d61dbde3a7ca5b41c601f7b to your computer and use it in GitHub Desktop.
print(max(next(filter(None,(g(b[v]%5) or g(b.pop(v)//5+5) or max(c)==5 and (i,sum(map(int,b.keys()))*int(v)) for i,v in enumerate(d) if v in b))) for f in [open(0)] for d in [next(f).strip().split(',')] for b in [{k:i for i,k in enumerate(b)} for b in zip(*[iter(f.read().split())]*25)] for c in [[0]*10] for g in [lambda i:c.__setitem__(i,c[i]+1)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment