Pregunta de entrevista de Amazon

medium difficulty of leetcode problems