当前位置:网站首页>It won't last for 65 days. It only appears once
It won't last for 65 days. It only appears once
2022-07-29 04:16:00 【A little Ming】
class Solution {
public int singleNonDuplicate(int[] nums) {
int low = 0, high = nums.length - 1;
while (low < high) {
int mid = (high - low) / 2 + low;
if (nums[mid] == nums[mid ^ 1]) {
low = mid + 1;
} else {
high = mid;
}
}
return nums[low];
}
}
author :LeetCode-Solution
link :https://leetcode.cn/problems/skFtm2/solution/pai-xu-shu-zu-zhong-zhi-chu-xian-yi-ci-d-jk8w/
source : Power button (LeetCode)
The copyright belongs to the author . Commercial reprint please contact the author for authorization , Non-commercial reprint please indicate the source .
边栏推荐
- [kvm] install KVM
- 不会就坚持60天吧 神奇的字典
- 伏英娜:元宇宙就是新一代互联网!
- MPU6050
- C语言:浅谈各种复杂的声明
- Incubator course design (April 12, 2021)
- 编译与链接
- Model tuning, training model trick
- Don't the JDBC SQL connector of the big guys Flink now support all databases, such as vertica?
- Class starts! See how smardaten decomposes complex business scenarios
猜你喜欢
不会就坚持58天吧 实现前缀树
Compilation and linking
RMAN do not mark expired backups
Problems encountered in vscode connection SSH
Two forms of softmax cross entropy + numpy implementation
Beginner: array & String
Record of problems encountered in ROS learning
不会就坚持69天吧 合并区间
Design of environment detection system based on STM32 and Alibaba cloud
[hands on deep learning] environment configuration (detailed records, starting from the installation of VMware virtual machine)
随机推荐
kotlin的List,Map,Set等集合类不指定类型
[paper translation] vectornet: encoding HD maps and agent dynamics from vectorized representation
Machine vision series 3:vs2019 opencv environment configuration
不会就坚持68天吧 狒狒吃香蕉
Locker 2022.1.1
[common commands]
Jenkins 参数化构建中 各参数介绍与示例
14.haproxy+keepalived负载均衡和高可用
The data source is SQL server. I want to configure the incremental data of the last two days of the date field updatedate to add
Pix2.4.8 from start to installation (2021.4.4)
Target detection learning process
Implementation of jump connection of RESNET (pytorch)
[untitled]
MPU6050
C language - character array - string array - '\0' -sizeof-strlen() -printf()
Common components of solder pad (2021.4.6)
不会就坚持65天吧 只出现一次的数字
C语言:结构体简单语法总结
STM32F103ZET6程序移植为C8T6+C8T6下载程序flash timeout的解决方案
Leftmost prefix principle of index