Skip to content

Instantly share code, notes, and snippets.

@lune-sta
Created August 10, 2012 05:59
Show Gist options
  • Save lune-sta/3311530 to your computer and use it in GitHub Desktop.
Save lune-sta/3311530 to your computer and use it in GitHub Desktop.
Project Euler 19-2
require 'date'
st = Date::new(1901, 1, 1)
en = Date::new(2000, 12, 31)
count = 0
while st != en
count += 1 if st.day == 1 && st.wday == 0
st += 1
end
p count # 171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment