Pregunta de entrevista de Amazon

Leetcode based questions most likely easy to medium