Pregunta de entrevista de J.P. Morgan

One easy and one medium leetcode questions.