Pregunta de entrevista de Amazon

Leetcode medium and easy type questions.