2014年10月13日

[leetcode] Longest Common Prefix @ Python

摘要: Source:https://oj.leetcode.com/problems/longest-common-prefix/Write a function to find the longest common prefix string amongst an array of strings.Hi... 阅读全文

posted @ 2014-10-13 22:33 AIDasr 阅读(729) 评论(0) 推荐(0) 编辑

[leetcode] path sum @ Python [recursion]

摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文

posted @ 2014-10-13 00:22 AIDasr 阅读(565) 评论(0) 推荐(0) 编辑

2014年10月7日

[leetcode]Distinct Subsequences @ Python

摘要: 原题地址:https://oj.leetcode.com/problems/distinct-subsequences/题意:Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subseq... 阅读全文

posted @ 2014-10-07 22:20 AIDasr 阅读(1165) 评论(0) 推荐(1) 编辑

2014年10月6日

[leetcode]Best Time to Buy and Sell Stock III @ Python

摘要: 原题地址:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/题意:Say you have an array for which theithelement is the price of a given sto... 阅读全文

posted @ 2014-10-06 22:55 AIDasr 阅读(1093) 评论(0) 推荐(0) 编辑

2014年10月1日

[leetcode]Populating Next Right Pointers in Each Node @ Python [逻辑动力学]

摘要: (坦率的说,这道题目感动了我, 让我这个编程新手体验到了逻辑的美)原题地址:https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/题意: 1 / \ 2 ... 阅读全文

posted @ 2014-10-01 11:28 AIDasr 阅读(750) 评论(0) 推荐(0) 编辑

[leetcode] Longest Valid Parentheses @python

摘要: Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest... 阅读全文

posted @ 2014-10-01 07:20 AIDasr 阅读(464) 评论(0) 推荐(0) 编辑

[leetcode] Valid Parentheses @Python

摘要: https://oj.leetcode.com/problems/valid-parentheses/Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the inp... 阅读全文

posted @ 2014-10-01 00:07 AIDasr 阅读(781) 评论(1) 推荐(0) 编辑

2014年9月30日

[leetcode]Merge k Sorted Lists @ Python [基础知识: heap]

摘要: 原题地址:https://oj.leetcode.com/problems/merge-k-sorted-lists/题意:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its com... 阅读全文

posted @ 2014-09-30 22:54 AIDasr 阅读(274) 评论(0) 推荐(0) 编辑

[leetcode] Largest Rectangle in Histogram @ Python [图解] [很难]

摘要: 原题地址:https://oj.leetcode.com/problems/largest-rectangle-in-histogram/题意:Givennnon-negative integers representing the histogram's bar height where the ... 阅读全文

posted @ 2014-09-30 09:50 AIDasr 阅读(361) 评论(0) 推荐(0) 编辑

[leetcode] Count and Say @ Python

摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文

posted @ 2014-09-30 06:34 AIDasr 阅读(277) 评论(0) 推荐(0) 编辑

导航