Pergunta de entrevista da empresa Red Hat

2Sum code question (can be wrriten in any language)