ruijiege

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2021年7月22日

摘要: https://leetcode-cn.com/problems/first-bad-version/ public int firstBadVersion(int n) { int left=0,right=n,mid; while (left<right){ mid = ((right-left 阅读全文
posted @ 2021-07-22 17:47 哦哟这个怎么搞 阅读(20) 评论(0) 推荐(0) 编辑

摘要: public static int search(int[] nums, int target) { //双指针 int left=0,right=nums.length-1; int mid=0; int res = -1; while (left<=right){ //防止int溢出如果是写为( 阅读全文
posted @ 2021-07-22 17:40 哦哟这个怎么搞 阅读(28) 评论(0) 推荐(0) 编辑