摘要: Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) justified.You should p... 阅读全文
posted @ 2015-01-12 16:56 Eason Liu 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion1.Ifversion1>version2return 1, ifversion1 val2) return 1;26 if (val1 < val2) return -1;27 ... 阅读全文
posted @ 2015-01-12 15:49 Eason Liu 阅读(3580) 评论(0) 推荐(0) 编辑
摘要: A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its index.... 阅读全文
posted @ 2015-01-12 14:05 Eason Liu 阅读(309) 评论(0) 推荐(0) 编辑
摘要: Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Credits:Special thanks to@tsf... 阅读全文
posted @ 2015-01-12 13:40 Eason Liu 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially... 阅读全文
posted @ 2015-01-12 13:24 Eason Liu 阅读(164) 评论(0) 推荐(0) 编辑