摘要: ```python class Solution: ''' 倍增divisor,每次将结果保存到divisor_multiadd_list, divisor_multiadd_list[k]=2^k * divisor ''' def divide(self, dividend: int, divisor: int) -> int: #溢出处理 if dividend 2**31 and divi 阅读全文
posted @ 2019-12-04 13:03 benda 阅读(82) 评论(0) 推荐(0) 编辑
摘要: ```python class Solution: def strStr(self, haystack: str, needle: str) -> int: def kmp_nextval(needle): nextval=[] i,j=0,-1 nextval.append(j) while len(nextval)<len(needle): if j 1 or needle[i]==needl 阅读全文
posted @ 2019-12-04 12:51 benda 阅读(90) 评论(0) 推荐(0) 编辑