Skip to content

Commit 26a66e0

Browse files
committed
Add type hints and reference links
1 parent 1f506f1 commit 26a66e0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

project_euler/problem_191/sol1.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@
1919
LAOO LAOA LAAO
2020
2121
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
2226
"""
2327

2428

25-
def solution(days=30):
29+
def solution(days: int = 30) -> int:
2630
"""Returns the number of possible prize strings for a particular number
2731
of days, using a simple recursive function with caching to speed it up.
2832
@@ -36,7 +40,7 @@ def solution(days=30):
3640
cache = {}
3741

3842
# we will be using a simple recursive function
39-
def calculate(days, absent, late):
43+
def calculate(days: int, absent: int, late: int) -> int:
4044
# if we are absent twice, or late 3 consecutive days,
4145
# no further prize strings are possible
4246
if late == 3 or absent == 2:

0 commit comments

Comments
 (0)