摘要: 1 //从右往左 先排序一下 然后右到左进行替换 这样替换位置之前的index不会变 2 //注意一下Comparator的写法 3 class Solution { 4 public String findReplaceString(String S, int[] indexes, String[] sources, String[] targets) { 5 ... 阅读全文
posted @ 2018-10-17 12:18 jasoncool1 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 1 //自己简化了 100% 2 class Solution { 3 public String getHint(String secret, String guess) { 4 int bull = 0; 5 int cow = 0; 6 char[] arr1 = secret.toCharArray(); 7 ... 阅读全文
posted @ 2018-10-17 09:23 jasoncool1 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 找substring存在不存在可以直接用indexOf() 或者contains() 不用一个一个比 边界情况是 c abc a 这样子 b.length()/a.length() == 1 所以要+2 阅读全文
posted @ 2018-10-17 03:42 jasoncool1 阅读(82) 评论(0) 推荐(0) 编辑