Question d’entretien chez Alibaba Group

String problem in LeetCode. Some basic list operation in Python should suffice.