摘要: Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters. The input string does not contain lea 阅读全文
posted @ 2016-08-30 13:19 LiBlog 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm? Analysis: Binary search: the first 阅读全文
posted @ 2016-08-30 12:02 LiBlog 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文
posted @ 2016-08-30 11:50 LiBlog 阅读(137) 评论(0) 推荐(0) 编辑
摘要: An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations: Assume you have a dicti 阅读全文
posted @ 2016-08-30 08:29 LiBlog 阅读(203) 评论(0) 推荐(0) 编辑
摘要: There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have t 阅读全文
posted @ 2016-08-30 06:52 LiBlog 阅读(155) 评论(0) 推荐(0) 编辑
摘要: There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have t 阅读全文
posted @ 2016-08-30 05:39 LiBlog 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num 阅读全文
posted @ 2016-08-30 03:44 LiBlog 阅读(130) 评论(0) 推荐(0) 编辑
摘要: The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2016-08-30 02:23 LiBlog 阅读(140) 评论(0) 推荐(0) 编辑