Question d’entretien chez Huawei Technologies

Could you write the recursive function