diff --git a/2016/ruby/day_24.rb b/2016/ruby/day_24.rb index 66091fb..19d1dae 100644 --- a/2016/ruby/day_24.rb +++ b/2016/ruby/day_24.rb @@ -96,6 +96,7 @@ if __FILE__ == $0 .map(&:first) .permutation .select {|route| route[0] == 0 } + .map {|route| route + [0] } .map {|route| [route, route.each_cons(2).map {|a,b| hash[[a,b]] }.inject(:+)] }.sort_by(&:last)