Qm

How many leap years from 1901 to 2100?

How many leap years are there from 1901 to 2100 inclusive? Do it by counting rather than by listing two hundred years.

State the leap-year rule, explain why the naive answer of 50 is wrong, and say how many leap years a full 400-year cycle contains.

Show a hint

Every fourth year is a leap year, except century years, which are leap years only when divisible by 400.

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

Born on 29 February, how many birthdays by age 40?How many weekdays appear 53 times in a year?What day of the week was 1 January 2000?How many days are there in a century?The month with exactly four of every weekday
All questions →