摘要:
class Solution { public List<List<Integer>> verticalOrder(TreeNode root) { if(root == null) return new ArrayList<>(); Map<Integer,List<Integer>> map = 阅读全文
posted @ 2020-07-14 19:23
Sexyomaru
阅读(101)
评论(0)
推荐(0)
摘要:
class Solution { public int longestConsecutive(TreeNode root) { dfs(root); return res; } private int res = 0; public int[] dfs(TreeNode root) { // 以ro 阅读全文
posted @ 2020-07-14 17:38
Sexyomaru
阅读(358)
评论(0)
推荐(0)
摘要:
class Solution { public int maxPathSum(TreeNode root) { dfs(root); return res; } int res = Integer.MIN_VALUE; public int dfs(TreeNode root) { // 返回以当前 阅读全文
posted @ 2020-07-14 17:35
Sexyomaru
阅读(126)
评论(0)
推荐(0)
摘要:
方法一: class Solution { public int longestConsecutive(int[] nums) { Set<Integer> set = new HashSet<>(); for(int num : nums) set.add(num); int res = 0; f 阅读全文
posted @ 2020-07-14 11:05
Sexyomaru
阅读(98)
评论(0)
推荐(0)
摘要:
class Solution { public Node connect(Node root) { if(root==null) return root; if(root.left!=null && root.right!=null){ root.left.next=root.right; } if 阅读全文
posted @ 2020-07-14 10:43
Sexyomaru
阅读(107)
评论(0)
推荐(0)
摘要:
方法一: class Solution { public String removeKdigits(String num, int k) { int n = num.length(); if(n <= k) return "0"; StringBuilder sb = new StringBuild 阅读全文
posted @ 2020-07-14 09:58
Sexyomaru
阅读(124)
评论(0)
推荐(0)

浙公网安备 33010602011771号