Skip to content
← Back to the archive

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 numbers
  • Only compare neighbouring days

Function signature

def busier_mornings(visitors):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.