GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • 注册
  • Plus 会员

This view

  • Original page
  • New address

GeezerVison is showing leetcode.cn — LCR 070. 有序数组中的单一元素 - 力扣(LeetCode)

题目描述
题目描述
题解
题解
提交记录
提交记录
LCR 070. 有序数组中的单一元素
中等

给定一个只包含整数的有序数组 nums ,每个元素都会出现两次,唯有一个数只会出现一次,请找出这个唯一的数字。

 

示例 1:

输入: nums = [1,1,2,3,3,4,4,8,8]
输出: 2

示例 2:

输入: nums =  [3,3,7,7,10,11,11]
输出: 10

 

 

提示:

  • 1 <= nums.length <= 105
  • 0 <= nums[i] <= 105

 

进阶:采用的方案可以在 O(log n) 时间复杂度和 O(1) 空间复杂度中运行吗?

 

注意:本题与主站 540 题相同:https://leetcode.cn/problems/single-element-in-a-sorted-array/

 
代码
代码
测试用例
测试用例
测试结果
测试结果
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.