摘要:
# Definition for a binary tree node.class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = Noneclass Solution(objec 阅读全文
posted @ 2019-03-17 13:57
AceKo
阅读(58)
评论(0)
推荐(0)
摘要:
#coding=utf-8# Definition for a binary tree node.class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None# 递归cla 阅读全文
posted @ 2019-03-17 13:56
AceKo
阅读(161)
评论(0)
推荐(0)
摘要:
# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution 阅读全文
posted @ 2019-03-17 13:55
AceKo
阅读(132)
评论(0)
推荐(0)
摘要:
class Solution(object): def zhuhanshu(self,n): self.count = 0 self.memo = [-1 for i in range(n+1)] def fib1(self,n): if n == 0 or n == 1: return 1 els 阅读全文
posted @ 2019-03-17 13:54
AceKo
阅读(108)
评论(0)
推荐(0)
摘要:
class Solution(object): def zhuhanshu(self,n): self.count = 0 self.memo = [-1 for i in range(n+1)] def fib1(self,n): if n == 0 or n == 1: return 1 els 阅读全文
posted @ 2019-03-17 13:50
AceKo
阅读(202)
评论(0)
推荐(0)
摘要:
#coding=utf-8# 最长公共子序列# s1[m] = s2[n]# LSC(m,n) = LSC(m-1,n-1) + 1# s1[m] != s2[n]# LSC= max(LSC(m-1,n),LSC(m,n-1))class Solution(object): def findlcs 阅读全文
posted @ 2019-03-17 13:49
AceKo
阅读(150)
评论(0)
推荐(0)
摘要:
#coding=utf-8# 递归1 递归到底# 序列选与不选的模板题 o(2**n) 20190307 找工作期间class Solution1(object): def findTargetSumWays(self, nums, S): """ :type nums: List[int] :ty 阅读全文
posted @ 2019-03-17 13:48
AceKo
阅读(228)
评论(0)
推荐(0)
摘要:
# coding=utf8# 递归# 递归过程是错的,求子集过程错误class Solution1(object): def findMaxForm(self, strs, m, n): """ :type strs: List[str] :type m: int :type n: int :rty 阅读全文
posted @ 2019-03-17 13:47
AceKo
阅读(151)
评论(0)
推荐(0)
摘要:
# coding=utf8# 递归class Solution1(object): def combinationSum4(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ if not 阅读全文
posted @ 2019-03-17 13:46
AceKo
阅读(257)
评论(0)
推荐(0)
摘要:
# coding=utf8# 递归class Solution1(object): def combinationSum4(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ if not 阅读全文
posted @ 2019-03-17 13:45
AceKo
阅读(222)
评论(0)
推荐(0)