Pregunta de entrevista de Amazon

Leetcode style coding questions as usual