Pregunta de entrevista de Meta

usual leetcode programming questions. I could solve them.