diff --git "a/problems/0151.\347\277\273\350\275\254\345\255\227\347\254\246\344\270\262\351\207\214\347\232\204\345\215\225\350\257\215.md" "b/problems/0151.\347\277\273\350\275\254\345\255\227\347\254\246\344\270\262\351\207\214\347\232\204\345\215\225\350\257\215.md" index b5246a7dbb..a5aabb96a5 100755 --- "a/problems/0151.\347\277\273\350\275\254\345\255\227\347\254\246\344\270\262\351\207\214\347\232\204\345\215\225\350\257\215.md" +++ "b/problems/0151.\347\277\273\350\275\254\345\255\227\347\254\246\344\270\262\351\207\214\347\232\204\345\215\225\350\257\215.md" @@ -492,7 +492,7 @@ class Solution: if s[fast] != " ": if len(result) != 0: result += " " - while s[fast] != " " and fast < len(s): + while fast < len(s) and s[fast] != " ": # 交换顺序会出现数组越界 result += s[fast] fast += 1 else: