Leap Year
In general, leap years occur every 4 years, but with some exceptions. If a year is divisible by 4, it is a leap year, except if it is also divisible by 100. However, if it is divisible by 400, then it is still a leap year.

So 1900 was not a leap year (divisible by 100), 1996 was a leap year (divisible by 4, and not 100), 1998 was not a leap year, and 2000 was a leap year (because even though it's divisible by 100, it's also divisible by 400).

Complete the function leapYear(year) below so that it returns true if year is a leap year, and false otherwise.

Log in - Sign up