上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页
摘要: https://leetcode.com/problems/string-to-integer-atoi/discuss/4672/JAVA-Easy-Version-To-Understand!!!!!!!!!! 用sum = sum*10 + 这位数字来计算 不能直接通过-Integer.MIN 阅读全文
posted @ 2018-10-08 03:37 jasoncool1 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 1 class MyStack { 2 Queue queue; 3 4 /** Initialize your data structure here. */ 5 public MyStack() { 6 queue = new LinkedList(); 7 8 } 9 10 /** ... 阅读全文
posted @ 2018-10-08 01:52 jasoncool1 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 创一个root node, 不用什么值, TrieNode要有一个26到数组记录每个字母存不存在,再来一个isWord给每个node判断一下是不是一个word(单词最后一个node才是一个word) 阅读全文
posted @ 2018-10-08 01:22 jasoncool1 阅读(94) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/linked-list-cycle-ii/discuss/44777/Concise-JAVA-solution-based-on-slow-fast-pointers fast slow, 刚开始全部初始化为0,当作起始点 阅读全文
posted @ 2018-10-07 12:49 jasoncool1 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 一次遍历,用一个map记录相同的string <String, List<String>> char[]到String 用new String() 阅读全文
posted @ 2018-10-07 06:23 jasoncool1 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 记录一个current char, 用j循环到没有一样的为止,要是count>1的话,就把数字放进去 阅读全文
posted @ 2018-10-06 13:51 jasoncool1 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 不是min就直接push一个min刀minStack 阅读全文
posted @ 2018-10-06 09:17 jasoncool1 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public boolean isRectangleOverlap(int[] rec1, int[] rec2) { 3 if((rec2[0]=rec1[2] && rec2[2]>=rec1[2])) { 4 return false; 5 }else { 6 ... 阅读全文
posted @ 2018-10-02 03:53 jasoncool1 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1 //用list比较快 2 class Solution { 3 public String frequencySort(String s) { 4 if(s.length() == 0 || s.length() == 1) return s; 5 HashMap map = new HashMap(); 6 cha... 阅读全文
posted @ 2018-09-28 06:08 jasoncool1 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public int islandPerimeter(int[][] grid) { 3 if(grid == null) return 0; 4 int row = grid.length; 5 if(row == 0) return 0; 6 int col = gr... 阅读全文
posted @ 2018-09-28 02:34 jasoncool1 阅读(120) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页