Check Leap Year

Given a positive integer year, return true if it is a leap year in the Gregorian calendar and false otherwise. A year is a leap year when it is divisible by…

Given a positive integer `year`, return `true` if it is a leap year in the Gregorian calendar and `false` otherwise. A year is a leap year when it is divisible by 400, or when it is divisible by 4 but not by 100.

- `1 ≤ year ≤ 9999` - `year` is an integer.

Example 1: input year = 2024; output true. 2024 is divisible by 4 and not by 100.

Example 2: input year = 1900; output false. 1900 is divisible by 100 but not by 400.

Example 3: input year = 2000; output true. 2000 is divisible by 400.

Category: Math. Topic: math. Difficulty: Easy. Patterns: math.