FunctionRacerProblemsRace

Leap Year

BeginnerMathPython, JavaScript, TypeScript, Java, C++

In the Gregorian calendar a year is a leap year if it is divisible by 4, except that years divisible by 100 are not leap years, unless they are also divisible by 400. Return True if year is a leap year.

Example 1

year 2024
returns true

Divisible by 4, not by 100.

Example 2

year 1900
returns false

Divisible by 100 but not 400.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems