Question d’entretien chez Tencent

Algorithm Problem Solving at the end.