File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
project_euler/problem_191 Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 19
19
LAOO LAOA LAAO
20
20
21
21
How many "prize" strings exist over a 30-day period?
22
+
23
+ References:
24
+ - The original Project Euler project page:
25
+ https://projecteuler.net/problem=191
22
26
"""
23
27
24
28
25
- def solution (days = 30 ):
29
+ def solution (days : int = 30 ) -> int :
26
30
"""Returns the number of possible prize strings for a particular number
27
31
of days, using a simple recursive function with caching to speed it up.
28
32
@@ -36,7 +40,7 @@ def solution(days=30):
36
40
cache = {}
37
41
38
42
# we will be using a simple recursive function
39
- def calculate (days , absent , late ) :
43
+ def calculate (days : int , absent : int , late : int ) -> int :
40
44
# if we are absent twice, or late 3 consecutive days,
41
45
# no further prize strings are possible
42
46
if late == 3 or absent == 2 :
You can’t perform that action at this time.
0 commit comments