Question d’entretien chez Huawei Technologies

For the live coding session I was asked to do LeetCode 644.