Pergunta de entrevista da empresa J.P. Morgan

They asked 2 algorithm questions.