Domanda di colloquio di Huawei Technologies

Could you write the recursive function