From d860795218edd56ccaae8adbfee3ac916bc8b3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sun, 8 Dec 2019 11:26:34 +0100 Subject: AAAAAAAAAAAAAAAAAA --- solutions/py/d04.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/solutions/py/d04.py b/solutions/py/d04.py index 3115f2a..5628925 100644 --- a/solutions/py/d04.py +++ b/solutions/py/d04.py @@ -10,11 +10,10 @@ def isIncreasing(num): return True def pt1(input): - return def containsDouble(num): s = str(num) amounts = [] - for n in (0,1,2,3,4,5,6,7,8,9): + for n in (0,1,2,3,4,5,6,7,8,9): # herregud amounts.append(s.count(str(n))) c = Counter(amounts) return c[0] + c[1] < 10 @@ -27,11 +26,10 @@ def pt1(input): return amount def pt2(input): - return def containsDouble(num): s = str(num) amounts = [] - for n in (0,1,2,3,4,5,6,7,8,9): + for n in (0,1,2,3,4,5,6,7,8,9): # herregud amounts.append(s.count(str(n))) c = Counter(amounts) if c[0] + c[1] < 10: @@ -43,3 +41,6 @@ def pt2(input): amount += 1 return amount +if __name__ == "__main__": + import cProfile + cProfile.run("pt1([])") -- cgit v1.2.1