Pergunta de entrevista da empresa Apple

Two sum problem and polymorphism