2019年3月26日
摘要: 最近遇到了这么一个需求,要接一家外部供应商,其中牵涉到接口回调,对方会把一些信息通过调用我们的接口发送给我们。 那么问题来了: 1. 我想在本地调试 2. 本地是内网环境 3. 公司的ip也不是固定的(==!) 4. 我手里恰好有一台便宜的阿里云机器,固定ip 所以最方便的做法当然是阿里云和我本地机 阅读全文
posted @ 2019-03-26 22:40 王 帅 阅读(368) 评论(0) 推荐(0) 编辑
摘要: The algorithm for this problem is not so hard to figure out. This is a problem of finding the length of the shortest path in graph. As I mentioned in 阅读全文
posted @ 2019-03-26 22:01 王 帅 阅读(128) 评论(0) 推荐(0) 编辑
  2019年3月25日
摘要: ```java class Solution { public int knightDialer(int N) { int cons = 1000000007; int[][] d = new int[10][N]; int[][] m = new int[][]{{4, 6, 1}, {6, 8, 阅读全文
posted @ 2019-03-25 21:53 王 帅 阅读(75) 评论(0) 推荐(0) 编辑
摘要: S has a maximum length of 1000, and it's easy to figure out the total count of numbers combined by substring of S. Which is 1 + min(2, S) + min(2^2, S 阅读全文
posted @ 2019-03-25 21:51 王 帅 阅读(70) 评论(0) 推荐(0) 编辑
  2019年3月24日
摘要: For each position, use A[i] to record the max value of A[j] + j, which j 阅读全文
posted @ 2019-03-24 17:49 王 帅 阅读(78) 评论(0) 推荐(0) 编辑
摘要: ```java class Solution { public boolean canThreePartsEqualSum(int[] A) { int sum = 0; for (int i = 0; i 阅读全文
posted @ 2019-03-24 17:48 王 帅 阅读(108) 评论(0) 推荐(0) 编辑
  2019年3月21日
摘要: Before the first AC, I was not quite sure if Arrays.sort is stable. so I wrote something like this. After read Arrays.sort's doc. (Surely stable sort) 阅读全文
posted @ 2019-03-21 22:33 王 帅 阅读(178) 评论(0) 推荐(0) 编辑
  2019年3月20日
摘要: ```java class Solution { public int shipWithinDays(int[] weights, int D) { int left = 1, right = 50000; int N = weights.length; for (int i = 0; i cap) { co... 阅读全文
posted @ 2019-03-20 23:29 王 帅 阅读(120) 评论(0) 推荐(0) 编辑
摘要: time =1 and = 2 and sum 500) continue; if (counter[target] != 0) ret += counter[target]; } counter[time[i]] += 1; } return ret; } } java public int nu 阅读全文
posted @ 2019-03-20 23:28 王 帅 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Suppose the given number is N, the result is R, it's easy to notice that N + R + 1 = 2^x, and x is unknown, but it's quite easy to calculate. for x fr 阅读全文
posted @ 2019-03-20 23:27 王 帅 阅读(89) 评论(0) 推荐(0) 编辑