Pergunta de entrevista da empresa ABC

Two sum was asked here.