aoc

Advent of Code Solutions
git clone git://git.alexkarle.com.com/aoc
Log | Files | Refs | README | LICENSE

b.py (302B) [raw]


      1 #!/usr/bin/env python3
      2 import sys
      3 
      4 # rather than keep a raw list, count number of each type!
      5 counts = [0] * 9
      6 
      7 for l in sys.stdin:
      8     for f in l.split(","):
      9         counts[int(f)] += 1
     10 
     11 for i in range(256):
     12     ready = counts.pop(0)
     13     counts[6] += ready
     14     counts.append(ready)
     15 
     16 print(sum(counts))