X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=01-ticket-prices%2Fday1.rb;h=4d05d837c1813751b7e153c620a1037037673eb5;hb=881b1889a51e7a0ea314b59234c477e0849c0427;hp=4be4935dcea6fa6456b4749cfc65ae417a015834;hpb=2b991385df5650b724c3044e1aa4a82ca949b12e;p=ou-summer-of-code-2017.git diff --git a/01-ticket-prices/day1.rb b/01-ticket-prices/day1.rb index 4be4935..4d05d83 100644 --- a/01-ticket-prices/day1.rb +++ b/01-ticket-prices/day1.rb @@ -15,6 +15,6 @@ def value(holiday) end part1 = affordable_holidays(holidays).length -part2 = affordable_holidays(holidays).max_by {|h| value h}[0] +part2 = affordable_holidays(holidays).max_by {|h| value h}.first puts "Part 1: #{part1}\nPart 2: #{part2}"