上一页 1 2 3 4 5 6 7 8 9 10 ··· 22 下一页
摘要: class Solution { public int minCut(String s) { int[] dp=new int[s.length()+1]; for(int i=0;i=0&&i+len=0&&i+len<s.length()&&s.charAt(i-1-len)==s.charAt(i+len);len++) ... 阅读全文
posted @ 2017-10-05 04:23 Weiyu Wang 阅读(133) 评论(0) 推荐(0) 编辑
摘要: class Solution { public List> partition(String s) { List> res=new ArrayList>(); generatePartition(0,new ArrayList(),res,s); return res; } private void generatePart... 阅读全文
posted @ 2017-10-05 01:43 Weiyu Wang 阅读(117) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public void solve(char[][] board) { if (board.length == 0 || board[0].length == 0) return; int m = board.length; int n = board[0].length; bool... 阅读全文
posted @ 2017-10-04 10:54 Weiyu Wang 阅读(108) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int sumNumbers(TreeNode root) { return sumNumber("", root); } private int sumNumber(String str, TreeNode node){ if(node==null) return 0... 阅读全文
posted @ 2017-10-04 05:44 Weiyu Wang 阅读(120) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int longestConsecutive(int[] nums) { Set set=new HashSet(); for(int num:nums) set.add(num); int res=0; for(int num:set) ... 阅读全文
posted @ 2017-10-04 05:36 Weiyu Wang 阅读(127) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int ladderLength(String beginWord, String endWord, List wordList) { Set dict=new HashSet(wordList); if(!dict.contains(endWord)) return 0; ... 阅读全文
posted @ 2017-10-04 05:27 Weiyu Wang 阅读(141) 评论(0) 推荐(0) 编辑
摘要: class Solution { public List> findLadders(String beginWord, String endWord, List wordList) { List> res=new ArrayList>(); Set dict=new HashSet(wordList); if(!dict.contains(... 阅读全文
posted @ 2017-10-04 05:09 Weiyu Wang 阅读(167) 评论(0) 推荐(0) 编辑
摘要: class Solution { int maxPathSum; public int maxPathSum(TreeNode root) { maxPathSum=Integer.MIN_VALUE; seachPathSum(root); return maxPathSum; } private int seac... 阅读全文
posted @ 2017-10-03 02:12 Weiyu Wang 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 压缩 阅读全文
posted @ 2017-10-02 03:22 Weiyu Wang 阅读(114) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int minimumTotal(List> triangle) { int[] dp=new int[triangle.size()]; for(int i=triangle.size()-1;i>=0;i--) for(int j=0;j<=i;j++) ... 阅读全文
posted @ 2017-09-30 09:48 Weiyu Wang 阅读(110) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 22 下一页