上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页

2017年5月28日

摘要: Note: 这道题很有意思,用的是二分法。想法是不停的试错。这个博客主把这个问题说的很清楚 https://xuezhashuati.blogspot.com/2017/03/lintcode-437-copy-books.html 其实二分法的方法可以变化的点很有限,最多变化的就是检查条件。一般难 阅读全文
posted @ 2017-05-28 03:28 codingEskimo 阅读(271) 评论(0) 推荐(0) 编辑

2017年5月26日

摘要: Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or  阅读全文
posted @ 2017-05-26 12:31 codingEskimo 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return the length of the LIS. Given a sequence of integer 阅读全文
posted @ 2017-05-26 11:05 codingEskimo 阅读(98) 评论(0) 推荐(0) 编辑

2017年5月25日

摘要: 方法一: 动态规划 https://segmentfault.com/a/1190000003768736 https://siddontang.gitbooks.io/leetcode-solution/content/dynamic_programming/perfect_squares.htm 阅读全文
posted @ 2017-05-25 12:15 codingEskimo 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Note:From back to start, if A[distance] is larger than the distance to the last element, it indicates that the last element is reachable. We can move 阅读全文
posted @ 2017-05-25 08:46 codingEskimo 阅读(120) 评论(0) 推荐(0) 编辑
摘要: public class Solution { /** * @param n: An integer * @return: An integer */ public int climbStairs(int n) { // write your code here if (n == 0 || n == 1) { ... 阅读全文
posted @ 2017-05-25 07:44 codingEskimo 阅读(84) 评论(0) 推荐(0) 编辑
摘要: public class Solution { /** * @param grid: a list of lists of integers. * @return: An integer, minimizes the sum of all numbers along its path */ public int minPathSum(int[][] ... 阅读全文
posted @ 2017-05-25 07:29 codingEskimo 阅读(74) 评论(0) 推荐(0) 编辑
摘要: Important point:During the iniitialize, the top or left side, if one grid is BLOCK, the rest of those points are all blocked. 阅读全文
posted @ 2017-05-25 07:13 codingEskimo 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Actually it can initial f[0][0] to 1, so that it can avoid a lot of coner checking. 阅读全文
posted @ 2017-05-25 06:53 codingEskimo 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Important: The hardest part is to define the state(here is f[x][y]) and its function(the relationship between them) 阅读全文
posted @ 2017-05-25 06:31 codingEskimo 阅读(110) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页

导航