27 August 2026
Busier Mornings
Medium
Lists
Count mornings that were busier than the morning immediately before.
You are given visitor counts for several days, listed from oldest to newest. Starting with the second day, compare each day's visitor count with the day before it. Keep track of the number of times the later day had more visitors than its previous. Return the final answer. If the list is empty, return 0. For example, [10, 14, 13, 16, 16] returns 2: - 14 is more than 10 - 16 is more than 13 - the final 16 is not more than the 16 before it
Constraints
visitor counts are non-negative whole numbersOnly compare neighbouring days
Function signature
def busier_mornings(visitors):