Pregunta de entrevista de Amazon

Based or greedy tree and HashMap