Pregunta de entrevista de Block

I was asked an easy LeetCode question.