2015 / 08
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# Date : 20XX.12.XX
|
||||
# Python Code
|
||||
# Developer : David Bandeira
|
||||
|
||||
import re
|
||||
import sys,time
|
||||
from helpingFunctions import *
|
||||
|
||||
@@ -13,13 +13,28 @@ aocYear = identifyYear(sys.argv[0])
|
||||
|
||||
path = getPath2Data(aocDay,aocYear)
|
||||
filename = getFilename2Data(aocDay)
|
||||
|
||||
|
||||
def cleanupData(dataRow):
|
||||
return eval(dataRow)
|
||||
|
||||
def countData(dataRow):
|
||||
lengthData = len(dataRow)
|
||||
lengthCleanData = len(cleanupData(dataRow))
|
||||
return lengthData-lengthCleanData
|
||||
|
||||
def countEscape(dataRow):
|
||||
return 2+dataRow.count('\\')+dataRow.count('"')
|
||||
|
||||
def taskA (data) -> int:
|
||||
gameScoreA = 0
|
||||
gameScoreA=0
|
||||
for dataRow in data:
|
||||
gameScoreA+=countData(dataRow)
|
||||
return gameScoreA
|
||||
|
||||
def taskB (data) -> int:
|
||||
gameScoreB = 0
|
||||
for dataRow in data:
|
||||
gameScoreB+=countEscape(dataRow)
|
||||
return gameScoreB
|
||||
|
||||
def task(task: int,data) -> int:
|
||||
|
||||
Reference in New Issue
Block a user