摘要:
https://leetcode.com/problems/arithmetic-slices/ public class Solution { public int numberOfArithmeticSlices(int[] A) { if (A.length < 3) { return 0; } int... 阅读全文
posted @ 2016-10-16 14:52
blcblc
阅读(246)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/fizz-buzz/ public class Solution { public List fizzBuzz(int n) { List lst= new ArrayList(); for (int i=1; i<=n; i++) { if (i % 15 == 0... 阅读全文
posted @ 2016-10-16 14:21
blcblc
阅读(290)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/battleships-in-a-board/ // 采用的是排除法,看船的最后一个节点 public class Solution { public int countBattleships(char[][] board) { int rows = board.length; int c... 阅读全文
posted @ 2016-10-16 14:15
blcblc
阅读(275)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/ 利用了异或的”自反性“: a ^ b = c,而a ^ b ^ b = a, 则 c ^ b = a 其他运算定律有:交换律、结合律、分配律。 注意:计算使用的 阅读全文
posted @ 2016-10-16 12:23
blcblc
阅读(2706)
评论(2)
推荐(0)
摘要:
开始实验这个,是因为Redis实战.pdf上面有例子。 上面用的是 org.jredis包,可是发现这个包不在maven的公共仓库里。需要先下载然后放在本地,导入maven依赖。详见: http://blog.csdn.net/zhu_tianwei/article/details/44900955 阅读全文
posted @ 2016-10-16 09:27
blcblc
阅读(6976)
评论(0)
推荐(1)
摘要:
Java String格式话参数整理如下: C++ String格式化参数整理如下: PHP String格式化参数整理如下: Python String格式化参数整理如下: Javascript String格式化参数整理如下: 原生语言,没有 Node中有sprintf包,见 https://n 阅读全文
posted @ 2016-10-16 08:17
blcblc
阅读(843)
评论(0)
推荐(0)