摘要: public int[] searchRange(int[] nums, int target) { int[] ans = {-1,-1}; if(nums.length == 0) return ans; else if(nums.length == 1) { if(nums[0] == tar 阅读全文
posted @ 2022-02-16 22:51 明卿册 阅读(28) 评论(0) 推荐(0)
摘要: public int countNodes(TreeNode root) { if(root == null) return 0; int left = countNodes(root.left); int right = countNodes(root.right); return left +  阅读全文
posted @ 2022-02-16 22:29 明卿册 阅读(15) 评论(0) 推荐(0)