From d1dd6f2b7f9440eaa1be65a7f507ec670a904375 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Wed, 9 Dec 2015 22:13:17 -0800 Subject: [PATCH] Day 9.1 --- day_09.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/day_09.rb b/day_09.rb index 7e8179c..0f3bf51 100644 --- a/day_09.rb +++ b/day_09.rb @@ -6,7 +6,7 @@ DATA.read.scan(/^(.*) to (.*) = (.*)$/).each do |from, to, distance| distances[from][to] = distance end locations = distances.keys -puts locations.permutation.map {|p| p.each_cons(2).map {|a,b| distances[a][b] }.inject(&:+) }.min +puts locations.permutation.map {|p| p.each_cons(2).map {|a,b| distances[a][b] }.inject(&:+) }.max __END__ Faerun to Tristram = 65 Faerun to Tambi = 129