上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 26 下一页
摘要: 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-07-12 23:19 ~每天进步一点点~ 阅读(84) 评论(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-07-12 21:48 ~每天进步一点点~ 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,... 阅读全文
posted @ 2015-07-12 21:25 ~每天进步一点点~ 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 首先对要求的数进行质因数分解,然后求各因数的幂的积数,比如600=2^3*3^1*5^2那么因子个数是(3+1)*(1+1)*(2+1)=24public class TestYuman{ public static void main(String[] args){ i... 阅读全文
posted @ 2015-07-12 20:52 ~每天进步一点点~ 阅读(1229) 评论(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-07-12 15:56 ~每天进步一点点~ 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.public class Solution { ... 阅读全文
posted @ 2015-07-12 15:46 ~每天进步一点点~ 阅读(93) 评论(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-07-12 15:31 ~每天进步一点点~ 阅读(124) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public double myPow(double x, int n) { //利用二分法,通过递归加速计算 //注意:1.判断n是否为负 // 2.递归结束条件,n==1和n==0 //... 阅读全文
posted @ 2015-07-12 14:19 ~每天进步一点点~ 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.public class Solution { public Lis... 阅读全文
posted @ 2015-07-12 13:59 ~每天进步一点点~ 阅读(162) 评论(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?In order to fulfill... 阅读全文
posted @ 2015-07-11 12:53 ~每天进步一点点~ 阅读(138) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 26 下一页