摘要: 1 public class Solution { 2 public boolean wordBreak(String s, Set<String> wordDict) { 3 int len = s.length(); 4 boolean[] isValidStart = new boolean[ 阅读全文
posted @ 2016-02-18 11:01 一切不期而至 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1 public class Solution { 2 public List<List<String>> findLadders(String beginWord, String endWord, Set<String> wordList) { 3 List<List<String>> res = 阅读全文
posted @ 2016-02-18 09:58 一切不期而至 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 1 public class Solution { 2 public int ladderLength(String beginWord, String endWord, Set<String> wordList) { 3 if(!isValidParam(beginWord, endWord, w 阅读全文
posted @ 2016-02-16 09:33 一切不期而至 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 1 public class Solution { 2 public boolean exist(char[][] board, String word) { 3 if(!isValidBoard(board) || word == null || word.length() == 0) { 4 r 阅读全文
posted @ 2016-02-15 01:50 一切不期而至 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 1 public class Solution { 2 public String convert(String s, int numRows) { 3 // illegal parameters 4 if(s == null || s.length() == 0 || numRows <= 0) 阅读全文
posted @ 2016-02-15 01:01 一切不期而至 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Question:https://leetcode.com/problems/implement-strstr/题目:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 i... 阅读全文
posted @ 2016-01-11 01:31 一切不期而至 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Question:https://leetcode.com/problems/gray-code/题目:The gray code is a binary numeral system where two successive values differ in only one bit.Given ... 阅读全文
posted @ 2016-01-10 03:48 一切不期而至 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Question:https://leetcode.com/problems/flatten-binary-tree-to-linked-list/题目:Given a binary tree, flatten it to a linked list in-place.For example,Giv... 阅读全文
posted @ 2016-01-07 11:37 一切不期而至 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Question:https://leetcode.com/problems/first-missing-positive/题目:Given an unsorted integer array, find the first missing positive integer.For example,... 阅读全文
posted @ 2016-01-07 11:05 一切不期而至 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Question:https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/题目:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicate... 阅读全文
posted @ 2016-01-05 12:08 一切不期而至 阅读(146) 评论(0) 推荐(0) 编辑