require "date"
def unlucky_days(year)
unlucky = 0
1.upto(12).each do |month|
date = Date.new(year, month, 13)
unlucky += 1 if date.wday == 5
end
unlucky
end
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Discussion on: Daily Challenge #27 - Unlucky Days
For further actions, you may consider blocking this person and/or reporting abuse