JasonChang

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 2 3 4 5 6 7 8 9 ··· 18 下一页

2013年11月22日

摘要: 1 public class Solution { 2 public ArrayList findSubstring(String S, String[] L) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ArrayList results = new ArrayList(); 6 int len = ... 阅读全文
posted @ 2013-11-22 02:11 JasonChang 阅读(217) 评论(0) 推荐(0) 编辑

2013年11月20日

摘要: 1 public class Solution { 2 public boolean isNumber(String s) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 if(s==null) 6 return false; 7 char[] sArr = s.trim().toCharArray... 阅读全文
posted @ 2013-11-20 16:46 JasonChang 阅读(178) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public String minWindow(String S, String T) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 if (S == null || T == null || S.length() == 0 || T.length() == 0) ... 阅读全文
posted @ 2013-11-20 16:42 JasonChang 阅读(216) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public boolean isMatch(String s, String p) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 int sLen = s.length(), pLen = p.length(); 6 int i = 0, j = ... 阅读全文
posted @ 2013-11-20 14:44 JasonChang 阅读(209) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public boolean isInterleave(String s1, String s2, String s3) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 int len1 = s1.length(), len2 = s2.length(), len3 =... 阅读全文
posted @ 2013-11-20 13:01 JasonChang 阅读(214) 评论(0) 推荐(0) 编辑

摘要: 1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 * TreeNode left; 6 * TreeNode right; 7 * TreeNode(int x) { val = x; } 8 * } 9 */10 public class Solution {11 public int maxPathSum(TreeNode root) {12 ArrayList maxSum = new ArrayList(... 阅读全文
posted @ 2013-11-20 12:24 JasonChang 阅读(164) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public boolean isMatch(String s, String p) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 if(p == null||p.length() == 0) return s == null||s.length()==0; 6 ... 阅读全文
posted @ 2013-11-20 12:12 JasonChang 阅读(187) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ArrayList merge(ArrayList intervals) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ArrayList result = new ArrayList(); 6 if(intervals == null... 阅读全文
posted @ 2013-11-20 11:24 JasonChang 阅读(170) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public boolean isScramble(String s1, String s2) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 int n=s1.length(); 6 boolean[][][] dp=new boolean[n][n... 阅读全文
posted @ 2013-11-20 10:58 JasonChang 阅读(175) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ArrayList spiralOrder(int[][] matrix) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ArrayList result = new ArrayList(); 6 if(matrix == null||... 阅读全文
posted @ 2013-11-20 10:50 JasonChang 阅读(197) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 18 下一页