Solved 164.
Solved 178.
Reworked 178 to use arrays instead of maps. Slightly faster.