. - 力扣(LeetCode) 直接用递归做 class Solution: def clearDigits(self, s: str) -> str: for i, c in enumerate(s): if c.isdigit(): new_str = s[:i - 1] + s[i+1:] return self.clearDigits(new_str) return s