上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 84 下一页
摘要: Implementint sqrt(int x).Compute and return the square root ofx.Hide TagsMathBinary Search思路:整体上用2分比逐个比较强。首先,给出一个错误的版本:错误之处在于红色部分,当mid较大时,mid*mid会超过IN... 阅读全文
posted @ 2015-03-10 11:35 穆穆兔兔 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 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-03-10 10:23 穆穆兔兔 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the problem stat... 阅读全文
posted @ 2015-03-09 14:52 穆穆兔兔 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文
posted @ 2015-03-07 15:06 穆穆兔兔 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... 阅读全文
posted @ 2015-03-07 13:45 穆穆兔兔 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Unique PathsTotal Accepted:36748Total Submissions:112531My SubmissionsQuestionSolutionA robot is located at the top-left corner of amxngrid (marked 'S... 阅读全文
posted @ 2015-03-07 13:12 穆穆兔兔 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.Hide ... 阅读全文
posted @ 2015-03-07 12:50 穆穆兔兔 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri... 阅读全文
posted @ 2015-03-06 15:15 穆穆兔兔 阅读(255) 评论(0) 推荐(0) 编辑
摘要: Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe... 阅读全文
posted @ 2015-03-06 13:23 穆穆兔兔 阅读(128) 评论(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-03-06 11:05 穆穆兔兔 阅读(147) 评论(0) 推荐(0) 编辑
上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 84 下一页