会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
LiYi's blog 。◕‿◕。
谦虚,诚实,正直
博客园
首页
新随笔
联系
管理
上一页
1
···
9
10
11
12
13
14
15
下一页
2014年10月15日
Binary Tree Zigzag Level Order Traversal
摘要: # Definition for a binary tree nodeclass TreeNode: def __init__(self, x): self.val = x self.left = None self.right = Noneclas...
阅读全文
posted @ 2014-10-15 13:36 clq.lib
阅读(159)
评论(0)
推荐(0)
2014年10月14日
Add Binary
摘要: class Solution: # @param a, a string # @param b, a string # @return a string def addBinary(self, a, b): #长度不等,补齐 len_a=len(a...
阅读全文
posted @ 2014-10-14 15:25 clq.lib
阅读(164)
评论(0)
推荐(0)
Combination Sum
摘要: 给出待选数字集合和目标值,要求得到所有的和为目标值的子集;例如 待选数字集合{ 2,3,6,7 },目标值7 ,=> { {2,2,3},{7} }可用递归,则递推式为:f([2,3,6,7],7)={{2+f([2,3,6,7],5)},{3+f([3,6,7],4)},{6+f([6,7],1)...
阅读全文
posted @ 2014-10-14 11:07 clq.lib
阅读(177)
评论(0)
推荐(0)
2014年10月13日
3Sum Closest
摘要: For example, given array S = {-1 2 1 -4}, and target = 1.The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).想来想去想不到什么好的解决方法,只好用最原始的方法,把所有可能的...
阅读全文
posted @ 2014-10-13 12:44 clq.lib
阅读(158)
评论(0)
推荐(0)
2014年10月10日
Triangle---minimum path sum
摘要: 动态规划class Solution: # @param triangle, a list of lists of integers # @return an integer def minimumTotal(self, triangle): depth=len(tr...
阅读全文
posted @ 2014-10-10 18:43 clq.lib
阅读(171)
评论(0)
推荐(0)
Partition List
摘要: # Definition for singly-linked list.class ListNode: def __init__(self, x): self.val = x self.next = Noneclass Solution: # @para...
阅读全文
posted @ 2014-10-10 17:45 clq.lib
阅读(125)
评论(0)
推荐(0)
2014年10月9日
Longest Common Prefix
摘要: class Solution: # @return a string def longestCommonPrefix(self, strs): num_items=len(strs) if num_itemslen(i): pre...
阅读全文
posted @ 2014-10-09 09:16 clq.lib
阅读(119)
评论(0)
推荐(0)
2014年10月8日
Count and Say
摘要: LeetCode 1 class Solution: 2 # @return a string 3 def countAndSay(self, n): 4 if n==1: 5 return "1" 6 else: 7 ...
阅读全文
posted @ 2014-10-08 16:20 clq.lib
阅读(165)
评论(0)
推荐(0)
字符串匹配
只有注册用户登录后才能阅读该文。
阅读全文
posted @ 2014-10-08 09:03 clq.lib
阅读(2)
评论(0)
推荐(0)
2014年9月30日
C++ 左值 右值
摘要: 最近在研究C++ 左值 右值,搬运、收集了一些别人的资料,供自己记录和学习,若以后看到了更好的解释,会继续补充。(打“?”是我自己不明白的地方 ) 参考:《Boost程序库探秘——深度解析C++准标准库(第2版)》 9787302342731 左值:一个可以用来存储数据的变量,有实际的内存地址(变量
阅读全文
posted @ 2014-09-30 10:38 clq.lib
阅读(588)
评论(0)
推荐(0)
上一页
1
···
9
10
11
12
13
14
15
下一页
公告