标签:class none style mat pre return 字符串 elf group
import re import math class Solution(object): def myAtoi(self, str): """ :type str: str :rtype: int """ r1 = re.match(r‘\s*[\-\+]?\d+‘,str) if r1!=None : r2=int(r1.group()) if r2<=-2147483648: return -2147483648 elif r2>=2147483648: return 2147483647 else: return r2 else: return 0
标签:class none style mat pre return 字符串 elf group
原文地址:https://www.cnblogs.com/xiao-xue-di/p/10291872.html