Question d’entretien chez Alipay

Just a coding problem, like leetcode medium. I should have done it.