Leap years

We use this kata to develop the fundamentals of classic test-driven development

Overview

Write a function that returns true or false depending on whether its input integer is a leap year or not.

Objectives

A leap year is defined as one that is divisible by 4, but is not otherwise divisible by 100 unless it is also divisible by 400.

Examples

Year

Type

Result

2019

Typical common year

false

2020

Typical leap year

true

2000

Atypical common year

false

1900

Atypical leap year

true

Last updated