摘要: 1 class Solution { 2 List> res = new ArrayList(); 3 public List> partition(String s) { 4 if(s.length() == 0) return res; 5 dfs(s, 0, new ArrayList() ); 6 return ... 阅读全文
posted @ 2018-09-23 23:58 jasoncool1 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 不知道说啥好,从边缘是O的开始标记不可能变的点,这样时间复杂度只有O(mn) 阅读全文
posted @ 2018-09-23 23:29 jasoncool1 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 1 //New 2 class Solution { 3 public int sumNumbers(TreeNode root) { 4 if(root == null) return 0; 5 return dfs(root, 0); 6 7 } 8 9 public int dfs(Tre... 阅读全文
posted @ 2018-09-23 11:29 jasoncool1 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Set会快很多替换各个位置的字符 在wordDict里面判断存不存在类似BFShttps://blog.csdn.net/u014532901/article/details/78820124 阅读全文
posted @ 2018-09-23 10:58 jasoncool1 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public int maxProfit(int[] prices) { 3 int len = prices.length; 4 if(len == 0 || len == 1) return 0; 5 int res = 0; 6 int buy = prices[0... 阅读全文
posted @ 2018-09-23 00:09 jasoncool1 阅读(109) 评论(0) 推荐(0) 编辑