Pregunta de entrevista de Pindrop

Machine learning questions, and improve my code using Hash maps.