摘要: Note: The following idea is in fact from the last answer inthis link, which leads to a clean code. I just reorganize it and add some explanations. I h... 阅读全文
posted @ 2015-07-14 23:55 jianchao-li 阅读(400) 评论(0) 推荐(0) 编辑
摘要: Well, an interesting problem. If you draw some examples on a white board and try to figure out the regularities, you may have noticed that the key to ... 阅读全文
posted @ 2015-07-14 21:35 jianchao-li 阅读(232) 评论(0) 推荐(0) 编辑
摘要: Well, since we need to make a deep copy of the list and nodes in the list have arandom pointer that may point to any node in the list (or NULL), we ne... 阅读全文
posted @ 2015-07-14 12:35 jianchao-li 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba... 阅读全文
posted @ 2015-07-14 12:13 jianchao-li 阅读(240) 评论(0) 推荐(0) 编辑
摘要: The key to this problem is to identify all the words that can be added to a line and then identify the places that require an additional space (to mak... 阅读全文
posted @ 2015-07-14 02:22 jianchao-li 阅读(234) 评论(0) 推荐(0) 编辑