上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 29 下一页
摘要: The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo... 阅读全文
posted @ 2015-11-06 16:08 eversliver 阅读(449) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.两数相除,不能用*,/,% 那么只能用位移运算了,注意边界条件防止溢出,代码如下... 阅读全文
posted @ 2015-11-05 21:13 eversliver 阅读(249) 评论(0) 推荐(0) 编辑
摘要: Implementint sqrt(int x).Compute and return the square root ofx.简单的二分法,注意mid应该选为long,否则容易溢出: 1 class Solution { 2 public: 3 int mySqrt(int x) { 4 ... 阅读全文
posted @ 2015-11-05 20:16 eversliver 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A ... 阅读全文
posted @ 2015-11-05 19:42 eversliver 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1 val2)20 return 1;21 else if(val1 < ... 阅读全文
posted @ 2015-11-04 20:44 eversliver 阅读(335) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2015-11-04 19:47 eversliver 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings.求很多string的公共前缀,用个两重循环就可以,代码如下: 1 class Solution { 2 public: 3 ... 阅读全文
posted @ 2015-11-04 19:23 eversliver 阅读(216) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Note:Do not modify the linked list.Follow up:Can you sol... 阅读全文
posted @ 2015-11-04 17:20 eversliver 阅读(217) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique perm... 阅读全文
posted @ 2015-11-04 15:23 eversliver 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2015-11-04 12:48 eversliver 阅读(207) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 29 下一页