Pregunta de entrevista de Apple

medium leetcode question has been asked