上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页
摘要: An abbreviation of a word follows the form . Below are some examples of word abbreviations:a) it --> it (no abbreviation) ... 阅读全文
posted @ 2015-10-11 13:36 茜茜的技术空间 阅读(1472) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted arraynums, reorder itin-placesuch thatnums[0] = nums[2] = nums[i - 1];Ifiis even, thennums[i] nums[i-1])){ swap(nums... 阅读全文
posted @ 2015-10-11 11:24 茜茜的技术空间 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2015-10-11 11:06 茜茜的技术空间 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Given a string, we can "shift" each of its letter to its successive letter, for example:"abc" -> "bcd". We can keep "shifting" which forms the sequenc... 阅读全文
posted @ 2015-10-11 10:05 茜茜的技术空间 阅读(867) 评论(0) 推荐(0) 编辑
摘要: Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"].解题思路:直观思路... 阅读全文
posted @ 2015-10-11 08:49 茜茜的技术空间 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Description:Count the number of prime numbers less than a non-negative number,n.解题思路:神一样的提示一步步给出了最佳解法。The Sieve of Eratosthenes uses an extra O(n) mem... 阅读全文
posted @ 2015-10-11 08:22 茜茜的技术空间 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 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 lead... 阅读全文
posted @ 2015-10-11 03:02 茜茜的技术空间 阅读(567) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".解题思路:用trim() 和splite("\\s+")把S... 阅读全文
posted @ 2015-10-11 02:35 茜茜的技术空间 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Rotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].Note:Try to come... 阅读全文
posted @ 2015-10-11 02:04 茜茜的技术空间 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp... 阅读全文
posted @ 2015-10-10 13:03 茜茜的技术空间 阅读(115) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页