2022年4月10日

摘要: https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/ class Solution { public int[] searchRange(int[] nums, int ta 阅读全文
posted @ 2022-04-10 15:02 wuniebing 阅读(14) 评论(0) 推荐(0) 编辑
 
摘要: 左侧边界 1 int left_bound(int[] nums, int target) { 2 int left = 0, right = nums.length - 1; 3 // 搜索区间为 [left, right] 4 while (left <= right) { 5 int mid 阅读全文
posted @ 2022-04-10 12:46 wuniebing 阅读(6) 评论(0) 推荐(0) 编辑