摘要: from typing import Listclass Solution: def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float: # 这样写可以不用判断两个数组和为奇数和偶数的情况 index1 阅读全文
posted @ 2020-07-06 10:34 月为暮 阅读(218) 评论(0) 推荐(0) 编辑
摘要: class Solution: def strStr(self, haystack: str, needle: str) -> int: # 判断needle是否为NOne或者为空字符串 if not needle or len(needle) == 0: return 0 # 定义两个变量,用来接 阅读全文
posted @ 2020-07-06 09:55 月为暮 阅读(211) 评论(0) 推荐(0) 编辑