Speed up problem 012 by adding type hints