[Leetcode] Length of Last Word 解题报告

摘要: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word ... 阅读全文
posted @ 2012-12-24 17:31 小刀初试 阅读(177) 评论(0) 推荐(0)

[LeetCode] Largest Rectangle in Histogram 解题报告

摘要: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist... 阅读全文
posted @ 2012-12-24 13:43 小刀初试 阅读(182) 评论(0) 推荐(0)

[LeetCode] Jump Game II 解题报告

摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
posted @ 2012-12-24 07:53 小刀初试 阅读(146) 评论(0) 推荐(0)

[LeetCode] Jump Game 解题报告

摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
posted @ 2012-12-24 06:40 小刀初试 阅读(186) 评论(0) 推荐(0)

[LeetCode] Interleaving String 解题报告

摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", retur... 阅读全文
posted @ 2012-12-24 06:06 小刀初试 阅读(183) 评论(0) 推荐(0)

[LeetCode] Integer to Roman 解题报告

摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.» Solve this problem[解题思路]这道题主要就在于如何处理每一位dig... 阅读全文
posted @ 2012-12-23 13:36 小刀初试 阅读(121) 评论(0) 推荐(0)

[LeetCode] Insert Interval 解题报告

摘要: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initial... 阅读全文
posted @ 2012-12-23 12:32 小刀初试 阅读(189) 评论(0) 推荐(0)

[LeetCode] Implement strStr() 解题报告

摘要: Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.» Solve this problem[解题思... 阅读全文
posted @ 2012-12-23 11:14 小刀初试 阅读(150) 评论(0) 推荐(0)

[LeetCode] Gray Code 解题报告

摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total numb... 阅读全文
posted @ 2012-12-23 06:37 小刀初试 阅读(180) 评论(0) 推荐(0)

[LeetCode] Generate Parentheses 解题报告

摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((... 阅读全文
posted @ 2012-12-22 14:29 小刀初试 阅读(180) 评论(0) 推荐(0)