上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
摘要: public class Solution { private char[][] board; private List result = new ArrayList(); public List findWords(char[][] board, String[]... 阅读全文
posted @ 2015-12-02 05:16 Weizheng_Love_Coding 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 动规public class Solution { public boolean isInterleave(String s1, String s2, String s3) { int length1 = s1.length(); int length2 = s2.... 阅读全文
posted @ 2015-12-02 04:38 Weizheng_Love_Coding 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 这个题目主要是需要处理两个数长度不一样的情况,有两个解决办法。我是采用递归,把长的那一段与carray再加。也可以把短的前面补0.public class Solution { public String addBinary(String a, String b) { int p... 阅读全文
posted @ 2015-12-02 03:16 Weizheng_Love_Coding 阅读(113) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String countAndSay(int n) { if (n == 1) { return "1"; } String str = "1"; for... 阅读全文
posted @ 2015-12-01 16:11 Weizheng_Love_Coding 阅读(118) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String longestCommonPrefix(String[] strs) { if (strs.length == 0) { return ""; } int... 阅读全文
posted @ 2015-12-01 15:55 Weizheng_Love_Coding 阅读(119) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public boolean containsNearbyDuplicate(int[] nums, int k) { HashMap map = new HashMap(); for (int i = 0; i < ... 阅读全文
posted @ 2015-12-01 15:48 Weizheng_Love_Coding 阅读(122) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public ListNode removeNthFromEnd(ListNode head, int n) { ListNode dummy = new ListNode(0); dummy.next = head;... 阅读全文
posted @ 2015-12-01 15:35 Weizheng_Love_Coding 阅读(98) 评论(0) 推荐(0) 编辑
摘要: public class Solution { boolean result = true; public boolean isBalanced(TreeNode root) { helper(root); return result; } pub... 阅读全文
posted @ 2015-12-01 15:28 Weizheng_Love_Coding 阅读(105) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int minDepth(TreeNode root) { if (root == null) { return 0; } Queue queue = new Link... 阅读全文
posted @ 2015-12-01 15:25 Weizheng_Love_Coding 阅读(124) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public boolean canAttendMeetings(Interval[] intervals) { Arrays.sort(intervals, new Comparator() { public... 阅读全文
posted @ 2015-12-01 15:06 Weizheng_Love_Coding 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页