Pregunta de entrevista de Meta

standard Leetcode questions, very easy