Pregunta de entrevista de Alibaba Group

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