Pregunta de entrevista de Amazon

I was asked leetcode easy/medium questions.