自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 0104.maximum-depth-of-binary-tree

# Definition for a binary tree node.# class TreeNode:# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution: def maxDepth(self, root: TreeNode) -> int: def MaxDepth(root).

2020-07-18 17:39:42 93

原创 0088.merge-sorted-array

from typing import List#--------testcase input---------l1a = [1,2,3,0,0,0]l1b = [2,5,6]#----------------------------main function--------------------------------# V1.0 要求原地修改,从后往前比较,并从后往前插入# def merge(nums1: List[int], m: int, nums2: List[int], n:.

2020-07-03 11:22:05 110

原创 0053.maximum-sum-subarray

from typing import Listimport sys#--------testcase input---------nums1 = [-2,1,-3,4,-1,2,1,-5,4]nums2 = [1]nums3 = [-2,1]nums4 = [-1,-2]nums5 = [-1,-2,-3,-4,-5,-6,-7]nums6 = [-1,-2,-3,1,-5,-6,-7]#----------------------------main function-------.

2020-07-02 09:39:07 152

原创 0026.remove-duplicates-from-sorted-array

from typing import Listimport operator#notice:#--------input---------nums1 = [0,0,1,1,1,2,2,3,3,4]nums2 = [1]nums3 = [1,1]nums4 = [1,2]nums5 = [1,1,2,3]#----------------------------success--------------------------------#时间复杂度 O() #空间复杂度 O(1).

2020-06-20 11:22:21 102

原创 0021.MergeTwoSortedLists

#----------------------------class init--------------------------------class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = nextclass LinkList(object): def __init__(self): self.head ..

2020-06-19 16:04:10 165

原创 0001.twoSum

from typing import List#--------暴力枚举---------#时间复杂度 O(N^2)#空间复杂度 O(1)# class Solution():# def __init__(self, nums: List[int], target: int) -> List[int]: # 关于为什要用__init__,可参考https://blog.csdn.net/geerniya/article/details/77487941# se.

2020-06-18 15:21:46 86

原创 0020.ValidParentheses

from typing import List#--------input---------s = ['{[([])]}']s1 = '[)'s2 = '()'s3 = ']'#----------------------------fail--------------------------------#--fail1:[)不能过...# def isVld(s: str) -> bool:# ram = []# for x in s:# .

2020-06-18 15:17:35 99

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除