上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页
摘要: This problem can be solved easily once you find the regularities :-) This link has done it for you. You may refer to its Python version. I rewrite it ... 阅读全文
posted @ 2015-08-08 14:52 jianchao-li 阅读(1427) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given an array of meeting time intervals consisting of start and end times[[s1,e1],[s2,e2],...](si& intervals) { 4 sort(in... 阅读全文
posted @ 2015-08-08 14:24 jianchao-li 阅读(4693) 评论(1) 推荐(0) 编辑
摘要: Problem Description: Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person 阅读全文
posted @ 2015-08-08 13:44 jianchao-li 阅读(2267) 评论(0) 推荐(0) 编辑
摘要: Problem Description:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Write a function to dete... 阅读全文
posted @ 2015-08-06 16:09 jianchao-li 阅读(2110) 评论(0) 推荐(0) 编辑
摘要: Problem Description:This is afollow upofShortest Word Distance. The only difference is now you are given the list of words and your method will be cal... 阅读全文
posted @ 2015-08-05 17:17 jianchao-li 阅读(3637) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given a list of words and two wordsword1andword2, return the shortest distance between these two words in the list.For example,Ass... 阅读全文
posted @ 2015-08-05 16:02 jianchao-li 阅读(3769) 评论(0) 推荐(0) 编辑
摘要: Problem Description: Implement an iterator to flatten a 2d vector.For example,Given 2d vector =[ [1,2], [3], [4,5,6]]By callingnextrepeatedly unti... 阅读全文
posted @ 2015-08-05 15:16 jianchao-li 阅读(2978) 评论(0) 推荐(0) 编辑
摘要: A relatively difficult tree problem. Well, a recursive solution still gives clean codes. The tricky part of this problem is how to record the result. ... 阅读全文
posted @ 2015-08-04 21:52 jianchao-li 阅读(228) 评论(0) 推荐(0) 编辑
摘要: An extension of Best Time to Buy and Sell Stock III. The idea is still to use dynamic programming (see here for detailed introduction). However, in th... 阅读全文
posted @ 2015-08-04 17:23 jianchao-li 阅读(216) 评论(0) 推荐(0) 编辑
摘要: Personally, this is a relatively difficult DP problem. This link posts a typical DP solution to it. You may need some time to get how it works.The cod... 阅读全文
posted @ 2015-08-03 14:49 jianchao-li 阅读(214) 评论(0) 推荐(0) 编辑
摘要: The function signature has been updated to return a more intuitivevector>which treats a single string as a group of anagrams consisting of only itself... 阅读全文
posted @ 2015-08-01 17:07 jianchao-li 阅读(867) 评论(0) 推荐(0) 编辑
摘要: Hash TableThis idea uses a hash table to record the times of appearances of each letter in the two stringssandt. For each letter ins, it increases the... 阅读全文
posted @ 2015-08-01 14:14 jianchao-li 阅读(291) 评论(0) 推荐(0) 编辑
摘要: To solve this problem, you first need to understand it well. The key problem is tell the difference of scramble from permutations. You may refer to th... 阅读全文
posted @ 2015-08-01 11:58 jianchao-li 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Well, this problem seems to be a little tricky at first glance. However, the idea (taken from this link) is really simple. Let's take the equation 2*3... 阅读全文
posted @ 2015-07-27 23:32 jianchao-li 阅读(421) 评论(0) 推荐(0) 编辑
摘要: Well, you may need to run some examples to have the intuition for the answer since we only require children with higher rating get more candies than t... 阅读全文
posted @ 2015-07-27 00:32 jianchao-li 阅读(159) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页