Pregunta de entrevista de Okta

They gave me a LeetCode Medium question