Pergunta de entrevista da empresa X

Two problems where I had to use hash tables