1 2 3 4 5 ··· 7 下一页
摘要: 题意: 数组只有0 1 组成,现在flip 任意的column , 所谓的 flip 就是把 0 ->1 or 1- >0, 比如 [1 1 0 1] 变成 [0 0 1 0]. 求经过翻转后 All 0 or All 1 的 row. 这题蛮烧脑的,仔细想想没那么复杂。 先说这个题目的算法:找ro 阅读全文
posted @ 2019-10-05 04:14 KeepAC 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 类似于 two points 的解法,非常好的指导思想。 和 821 Shortest Distance to a Character的解题思路是一样的。 题目可以转换成 数组中某个点 到特定字母的最小距离 比如 loveleetcode 求到字母e的最小距离 难点: 字母有可能出现在当前index 阅读全文
posted @ 2019-10-03 02:14 KeepAC 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 这题讲的是 每个worker 只能做比他能力难度小的或者一样的工作, 每个工作创造的价值不同,为workers 们能创造的最高价值。 比如worker0 = 4, diff = {1,3,4} profit= {100,10,10} 那这个worker 显然要挑选 100这个高的profit 去做。 阅读全文
posted @ 2019-09-30 02:51 KeepAC 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 这个题目本质上是一个graph 的BFS 题目,虽然光度题目很难看出来。 数组里是的value 表示走几步,负数表示往回走. “If a number k at an index is positive, then move forward k steps. Conversely, if it's 阅读全文
posted @ 2019-09-29 14:11 KeepAC 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 11 和 42 本质上都是木桶原理: 11 如何才能存最多的水? 假设 a[left] < a[right] , total = a[left] *(right-left) , 那么 right -1, right-2 位置 都比 total 小, 此时就没必要move right 了, 因为所有的 阅读全文
posted @ 2019-09-29 05:12 KeepAC 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 392 是一个easy题, 就是问 s 是否能由t 构成。 当然不能把 t 的 所有2^n个子串都拿出来,一一和s比较。 只需要two points就行了。 Example 1:s = "abc", t = "ahbgdc" 这道题很简单,但写出的code 可能差别很大,看看我第一次提交的code 阅读全文
posted @ 2019-09-27 15:33 KeepAC 阅读(139) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/ysocean/p/6889906.html 阅读全文
posted @ 2019-02-12 05:43 KeepAC 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 转自: https://my.oschina.net/pingjiangyetan/blog/423380 首先,Repository 是什么?Repository 是 文件的集合,这些文件,通过group、name和version 组织起来。在使用上,主要体现为jar 和 xml文件 Gradle 阅读全文
posted @ 2019-02-12 02:16 KeepAC 阅读(950) 评论(0) 推荐(0) 编辑
摘要: 1D-->1D List: new ArrayList<>(1D_list) 1D List添加 2D List List<List<Integer>> result; result.add(new ArrayList<>(curResult)) set to list; new ArrayList 阅读全文
posted @ 2019-02-09 08:11 KeepAC 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 每一个分支把leetcode backtracking 几十个题目重新复习一遍,领略back tracking 精髓。 一 排列问题: 46/47 Permutations : 46 没有重复数字 47 包含重复数字 46: 关键是采用used[i] 来标记一个i 是否已经被选择了, 注意used 阅读全文
posted @ 2019-02-09 02:56 KeepAC 阅读(244) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 7 下一页