summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2019-12-08 11:26:34 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2019-12-08 11:26:34 +0100
commitd860795218edd56ccaae8adbfee3ac916bc8b3fd (patch)
treefcd12a6718877ed35eeb3fd49c73163cfd2a3700
parent29e33f8f6a31565f5a2671b1c459ff1b829630f7 (diff)
downloadaoc-d860795218edd56ccaae8adbfee3ac916bc8b3fd.tar.gz
AAAAAAAAAAAAAAAAAA
-rw-r--r--solutions/py/d04.py9
1 files 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([])")