Move 2015 out of the way.

This commit is contained in:
Bert Peters
2016-12-01 11:25:19 +01:00
parent a75d14ec17
commit b37fd44fa7
50 changed files with 0 additions and 0 deletions

31
2015/day-08/solution.py Normal file
View File

@@ -0,0 +1,31 @@
from __future__ import print_function
import fileinput
import re
totalLess = 0
totalMore = 0
for line in fileinput.input():
original = len(line)
diff = 2
plus = 2
escaped = False
for c in line:
if c == "\\" or c == "\"":
plus += 1
if c == "\\" and not escaped:
escaped = True
diff += 1
continue
if escaped and c == "x":
diff += 2
escaped = False
totalLess += diff
totalMore += plus
print(totalLess, "less")
print(totalMore, "more")