This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def number_of_sweets(days): | |
""" | |
This function assumes the parameter, days, contains a list of integers in ascending order. | |
optimised function where the | |
sum_of_sweets counts every odd number and keeps track of the previous calculation. | |
This function more clearly displays its efficiency for very long lists. |