aoc2017-day03-2

Run Settings
LanguagePython
Language Version
Run Command
import sys import math def doit(input): i = 0 p = 0 spiral = [] while i < 3: s = (2*i+1)**2 d = 8*(i+1) spiral.append([[s+d], (s+d)*(s+d-1)/2]) print(i, s+d, (s+d)*(s+d-1)/2) i += 1 return "%s" % spiral input = sys.stdin.read() print(doit(input))
Editor Settings
Theme
Key bindings
Full width
Lines