Skip to content

Instantly share code, notes, and snippets.

View tombrereton's full-sized avatar

Tom Brereton tombrereton

View GitHub Profile
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.