上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: public class Solution { public boolean isAnagram(String s, String t) { char[] first = s.toCharArray(); Arrays.sort(first); cha... 阅读全文
posted @ 2015-12-01 15:03 Weizheng_Love_Coding 阅读(113) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int titleToNumber(String s) { int result = 0; int tmp = 1; for (int i = s.length() - 1; i >= 0;... 阅读全文
posted @ 2015-12-01 15:01 Weizheng_Love_Coding 阅读(104) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int longestConsecutive(int[] nums) { HashSet set = new HashSet(); for (int num : nums) { se... 阅读全文
posted @ 2015-12-01 10:02 Weizheng_Love_Coding 阅读(101) 评论(0) 推荐(0) 编辑
摘要: public class Solution { private int result = 0; public int longestConsecutive(TreeNode root) { if (root == null) { return 0; ... 阅读全文
posted @ 2015-12-01 09:54 Weizheng_Love_Coding 阅读(134) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int lengthOfLIS(int[] nums) { int length = nums.length; List record = new ArrayList(); for (int... 阅读全文
posted @ 2015-12-01 09:30 Weizheng_Love_Coding 阅读(119) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public boolean wordPatternMatch(String pattern, String str) { return helper(pattern, str, new HashMap(), new HashMap... 阅读全文
posted @ 2015-12-01 09:01 Weizheng_Love_Coding 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 用的dfs,但是感觉这个方法应该不是最优的,否则这个题目不应该是hardpublic class Solution { int up = Integer.MAX_VALUE; int low = Integer.MIN_VALUE; int left = Integer.MAX_V... 阅读全文
posted @ 2015-12-01 08:08 Weizheng_Love_Coding 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 相当tricky的一道题目,我怀疑在面试的时候有人能在45分钟想出来,我参考了一下https://leetcode.com/discuss/72215/java-dp-solution-with-detailed-explanation-o-n-3这个人的思路。public class Soluti... 阅读全文
posted @ 2015-12-01 07:07 Weizheng_Love_Coding 阅读(694) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int minCostII(int[][] costs) { int n = costs.length; if (n == 0) { return 0; } ... 阅读全文
posted @ 2015-12-01 07:04 Weizheng_Love_Coding 阅读(140) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public ListNode removeElements(ListNode head, int val) { ListNode dummy = new ListNode(0); dummy.next = head;... 阅读全文
posted @ 2015-12-01 05:12 Weizheng_Love_Coding 阅读(129) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页