上一页 1 ··· 62 63 64 65 66 67 68 69 70 ··· 84 下一页
摘要: Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].Hide TagsArray... 阅读全文
posted @ 2015-03-05 17:23 穆穆兔兔 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
posted @ 2015-03-05 15:24 穆穆兔兔 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ],... 阅读全文
posted @ 2015-03-04 18:41 穆穆兔兔 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.思路:和 N-queens 一样,不过只统计个数而言,... 阅读全文
posted @ 2015-03-04 16:54 穆穆兔兔 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinc... 阅读全文
posted @ 2015-03-04 16:05 穆穆兔兔 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x,n).思路:可以连乘,但会超时,所以使用二分法:注意几点:1 不要写成pow(x, n/2)* pow(x, n/2) 还是会超时,因为还是会计算两遍,直接使用临时变量tmp= pow(x, n/2),然会return tmp*tmp2 注意int 有可能为负数3 注... 阅读全文
posted @ 2015-03-04 14:41 穆穆兔兔 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.http://www.cnblogs.com/easonliu/p/364... 阅读全文
posted @ 2015-03-04 14:12 穆穆兔兔 阅读(202) 评论(0) 推荐(0) 编辑
摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路一:b[i][j] = a[n-1... 阅读全文
posted @ 2015-03-03 14:07 穆穆兔兔 阅读(214) 评论(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-02-12 17:06 穆穆兔兔 阅读(215) 评论(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-02-12 16:34 穆穆兔兔 阅读(172) 评论(0) 推荐(0) 编辑
上一页 1 ··· 62 63 64 65 66 67 68 69 70 ··· 84 下一页