Unlucky Years

Published by Mubashir Hassan in

Create a function which returns how many Friday 13ths there are in a given year.

Examples

how_unlucky(2020) ➞ 2

how_unlucky(2026) ➞ 3

how_unlucky(2016) ➞ 1

Notes

Check Resources for some helpful tutorials on the Ruby datetime module.

Watch a quick demo on how Edabit works.