Question d’entretien chez Tencent

Algorithm question question (I almost forgot it)