Pergunta de entrevista da empresa Huawei Technologies

Could you write the recursive function