上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */public... 阅读全文
posted @ 2016-01-24 14:44 爱推理的骑士 阅读(109) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int numDecodings(String s) { int len = s.length(); if(len == 0) return 0; int[] counts = new in... 阅读全文
posted @ 2016-01-24 14:14 爱推理的骑士 阅读(134) 评论(0) 推荐(0) 编辑
摘要: We can easily use hashset to solve this problem, based on the previous Subset problem.Code:public class Solution { public List> subsetsWithDup(int[... 阅读全文
posted @ 2016-01-24 12:18 爱推理的骑士 阅读(165) 评论(0) 推荐(0) 编辑
摘要: We can find the regular pattern in gray code, which is:the first of the combinations of n-digit gray code is exactly the combinations of (n-1)-digit g... 阅读全文
posted @ 2016-01-24 10:42 爱推理的骑士 阅读(136) 评论(0) 推荐(0) 编辑
摘要: At the first sight of the problem, I misunderstood it as sort the former part of the list and then keep the original order of those nodes in the large... 阅读全文
posted @ 2016-01-24 09:02 爱推理的骑士 阅读(144) 评论(0) 推荐(0) 编辑
摘要: First we need to get the head node, use a boolean value to mark whether we find a new head or not. When we traverse the linked list,if(cur.val != cur.... 阅读全文
posted @ 2016-01-24 07:32 爱推理的骑士 阅读(107) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public boolean search(int[] nums, int target) { int len = nums.length; if(len == 0) return false; int ... 阅读全文
posted @ 2016-01-24 06:40 爱推理的骑士 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Use DFS to find the possible path that match the string;Code:public class Solution { public boolean exist(char[][] board, String word) { if(... 阅读全文
posted @ 2016-01-22 14:20 爱推理的骑士 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Based on the combinations problem, we use a for loop to call the method created in that problem and this problem will be solved. Later we'll add bit m... 阅读全文
posted @ 2016-01-22 11:58 爱推理的骑士 阅读(146) 评论(0) 推荐(0) 编辑
摘要: At first, I thought we can use the permutation problem code to solve this problem. However, after some examination, I found the problem is quite diffe... 阅读全文
posted @ 2016-01-21 10:23 爱推理的骑士 阅读(82) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页