11 lines
274 B
Ruby
Executable File
11 lines
274 B
Ruby
Executable File
#!/bin/env ruby
|
|
require 'pry'
|
|
numbers = File.read('./input').split("\n").map(&:to_i).sort
|
|
|
|
solution = numbers.map.with_index do |num, i|
|
|
next if i == 0
|
|
num - numbers[i-1]
|
|
end
|
|
#binding.pry
|
|
final = [solution.count(1)+1, solution.count(3)+1]
|
|
pp final, final.reduce(&:*) |