📅  最后修改于: 2022-03-11 14:45:25.181000             🧑  作者: Mango
The reason why it didn't work before is during your for loop you are
mutating word which means that it will skip over an iteration whenever
you delete something because that deletion resulted in each letter moving
up a position.