[LeetCode] Longest Consecutive Sequence, Solution

摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest... 阅读全文
posted @ 2013-02-23 16:02 小刀初试 阅读(165) 评论(0) 推荐(0)

[LeetCode] Sum Root to Leaf Numbers, Solution

摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which... 阅读全文
posted @ 2013-02-23 15:35 小刀初试 阅读(133) 评论(0) 推荐(0)

[LeetCode] Word Ladder II, Solution

摘要: Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be ch... 阅读全文
posted @ 2013-02-23 10:24 小刀初试 阅读(176) 评论(0) 推荐(0)