Problem 1154 · Easy

Day of the Year

Given a calendar date, return how many days into its year it falls, counting the first of January as day one. The visual adds up month lengths in order, with a leap-year check for February.

Open the interactive visualisation