Pregunta de entrevista de Fractal

Basic Python Leetcode question.(Don't remember in detail).