上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页
摘要: 第三次写了,一遍过/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(i... 阅读全文
posted @ 2015-12-04 09:08 Weizheng_Love_Coding 阅读(135) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int[] twoSum(int[] numbers, int target) { int left = 0; int right = numbers.length - 1; while (... 阅读全文
posted @ 2015-12-04 08:03 Weizheng_Love_Coding 阅读(107) 评论(0) 推荐(0) 编辑
摘要: public class Solution { private int result = Integer.MIN_VALUE; public int maxPathSum(TreeNode root) { helper(root); return result... 阅读全文
posted @ 2015-12-04 07:34 Weizheng_Love_Coding 阅读(99) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int minSubArrayLen(int s, int[] nums) { int p1 = 0; int p2 = 0; int length = nums.length; ... 阅读全文
posted @ 2015-12-04 07:34 Weizheng_Love_Coding 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 第一个是递归方法,第二个是非递归方法public class Solution { public boolean isSymmetric(TreeNode root) { if (root == null) { return true; } ... 阅读全文
posted @ 2015-12-04 07:26 Weizheng_Love_Coding 阅读(108) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int findPeakElement(int[] nums) { int left = 0; int right = nums.length - 1; while (left + 1 n... 阅读全文
posted @ 2015-12-03 15:44 Weizheng_Love_Coding 阅读(117) 评论(0) 推荐(0) 编辑
摘要: public class ZigzagIterator { private List v1; private List v2; private int p1; private int p2; private boolean flg = true; publ... 阅读全文
posted @ 2015-12-03 13:44 Weizheng_Love_Coding 阅读(117) 评论(0) 推荐(0) 编辑
摘要: public class Solution { List result = new ArrayList(); public List letterCombinations(String digits) { if (digits.length() == 0) { ... 阅读全文
posted @ 2015-12-03 10:13 Weizheng_Love_Coding 阅读(109) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { int carry = 0; ListNode result = new ListNode(0); ... 阅读全文
posted @ 2015-12-03 09:50 Weizheng_Love_Coding 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 思路和ugly2一样,不过是变成了一组factor,用一个priority求出每次最小的,同时维护一个conut数组,记录每个factor走的次数有一个500000的过不了,超限了,无耻的写了一行作弊的代码public class Solution { public int nthSuperU... 阅读全文
posted @ 2015-12-03 09:20 Weizheng_Love_Coding 阅读(195) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页