leetcode
夜_树懒
这个作者很懒,什么都没留下…
展开
-
leetcode第一、二题
#leetcode第一题 class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: dct = {} for i, n in enumerate(nums): cp = target - n if cp in dct: return [dct[cp], i]原创 2020-12-02 17:39:10 · 86 阅读 · 0 评论 -
leetcode 第五题
class Solution: def findMedianSortedArrays(self, s) : for length in range(len(s), -1, -1): for index in range(0, len(s) - length + 1): sub_string = s[index:length + index] if sub_string == sub_string[原创 2020-12-02 17:38:45 · 98 阅读 · 0 评论