11 lines
404 B
Ruby
11 lines
404 B
Ruby
#!/bin/env ruby
|
|
require 'pry'
|
|
input = File.readlines('./input').map(&:strip)
|
|
literal_chars = input.map { |string| string.chars.count }
|
|
memory_chars = input.map { |string| string.undump.chars.count }
|
|
encode_chars = input.map { |string| string.dump.chars.count }
|
|
|
|
puts "Part 1 Solution: #{literal_chars.sum - memory_chars.sum}"
|
|
puts "Part 2 Solution: #{encode_chars.sum - literal_chars.sum}"
|
|
# binding.pry
|