J.P. Morgan interview question

They asked two coding questions.