2020-4: Take a Leap

Write code that, given an argument which is an integer array of year numbers greater than or equal to 1752 and less than 4000, returns a result of the same shape as the argument where 1 indicates that the corresponding year is a leap year (0 otherwise).

A leap year algorithm can be found at https://en.wikipedia.org/wiki/Leap_year#Algorithm.

Examples

Implementation

You can also run the tests via ⌘/shift + enter