Pregunta de entrevista de Huawei Technologies

Could you write the recursive function