Add day 13 solutions.

This commit is contained in:
2018-12-13 12:18:37 -08:00
parent c96b0c667e
commit 6eef99e081
2 changed files with 121 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
module Enumerable(T)
def count_each(others)
def count_each
count_map = {} of T => Int32
each do |other|
count_map[other] = (count_map[other]? || 0) + 1