摘要: Problem Description:Given a sorted integer array where the range of elements are [lower,upper] inclusive, return its missing ranges.For example, given... 阅读全文
posted @ 2015-06-25 23:20 jianchao-li 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Well, the key to this problem is on how to identify the recurring parts. After doing some examples using pen and paper, you may find that for the deci... 阅读全文
posted @ 2015-06-25 22:20 jianchao-li 阅读(281) 评论(0) 推荐(0) 编辑
摘要: The problem statement has stated that there are bothO(n)andO(nlogn)solutions to this problem. Let's see theO(n)solution first (taken fromthis link), w... 阅读全文
posted @ 2015-06-25 17:33 jianchao-li 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters.The input string d... 阅读全文
posted @ 2015-06-25 16:56 jianchao-li 阅读(237) 评论(0) 推荐(0) 编辑
摘要: This link has a great discussion about this problem. You may refer to it if you like. In fact, the idea and code in this passage is from the former li... 阅读全文
posted @ 2015-06-25 15:28 jianchao-li 阅读(774) 评论(0) 推荐(0) 编辑
摘要: Well, this problem has a nice BFS structure.Let's see the example in the problem statement.start = "hit"end = "cog"dict = ["hot", "dot", "dog", "lot",... 阅读全文
posted @ 2015-06-25 01:00 jianchao-li 阅读(310) 评论(0) 推荐(0) 编辑