Skip to content

Instantly share code, notes, and snippets.

@nicopaez
Last active July 30, 2016 23:44
Show Gist options
  • Save nicopaez/1e4d5bac6df9f3f3c54c19261cf18cab to your computer and use it in GitHub Desktop.
Save nicopaez/1e4d5bac6df9f3f3c54c19261cf18cab to your computer and use it in GitHub Desktop.

Leap Year Kata

A year is leap when it is divisible by 4 and is not divisible by 100 except it is also divisable by 400. Some examples:

  • 1900 is divisible by 4 is divisible by 100 is NOT divisible by 400 => is NOT leap

  • 1996 is divisible by 4 is NOT divisible by 100 => IS leap

  • 2000 is divisible by 4 is divisible by 100 is divisible by 400 => IS leap

  • 2001 it NOT divisible by 4 => is NOT leap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment