依次遍历 s 的每个字符,根据要求求解,当首字母是 "+-" 时,影响数字符号,其他情况判断字符是否为 "0-9",然后将数字拼接起来,最终判断结果是否超过范围 class Solution: def StrToInt(self , s: str) -> int: # write code here &n...