摘要: 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) 编辑