当前位置:网站首页>不会就坚持65天吧 只出现一次的数字
不会就坚持65天吧 只出现一次的数字
2022-07-29 04:13:00 【一只小小明】
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];
}
}
作者:LeetCode-Solution
链接:https://leetcode.cn/problems/skFtm2/solution/pai-xu-shu-zu-zhong-zhi-chu-xian-yi-ci-d-jk8w/
来源:力扣(LeetCode)
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
边栏推荐
- openFeign异步调用问题
- Value transmission and address transmission of C language, pointer of pointer
- C language: getchar () and cache
- 从淘宝,天猫,1688,微店,京东,苏宁,淘特等其他平台一键复制商品到拼多多平台(批量上传宝贝详情接口教程)
- How to write the filter conditions of data integration and what syntax to use? SQL syntax processing bizdate can not be
- 基于STM32和阿里云的环境检测系统设计
- Taobao product details interface (product details page data interface)
- VScode连接ssh遇到的问题
- MySQL第四篇(完结)
- opengauss预检查安装
猜你喜欢
MPU6050
STM32F103ZET6程序移植为C8T6+C8T6下载程序flash timeout的解决方案
SQL window function
BGP的基础配置---建立对等体、路由宣告
[kvm] create virtual machine from kickstart file
Object array merges elements according to a field
Is the browser multi process or single process?
Problems encountered in vscode connection SSH
When array is used as a function parameter, it is better to use the array size as a function parameter
Three tier architecture of enterprise network
随机推荐
Is there any way for Youxuan database to check the log volume that the primary cluster transmits to the standby cluster every day?
Big manufacturers finally can't stand "adding one second", and companies such as Microsoft, Google meta propose to abolish leap seconds
Design of environment detection system based on STM32 and Alibaba cloud
Rhel8 patch package production
这个报错是什么鬼啊,不影响执行结果,但是在执行sql时一直报错。。。连接maxComputer是使用
How to write SQL statements about field conversion
%s. %c, character constant, string constant, const char*, pointer array, string array summary
3. Solve pychart's error unresolved reference 'selenium' unresolved reference 'webdriver‘
RMAN do not mark expired backups
Communication between parent-child components and parent-child components provide and inject
[introduction to C language] zzulioj 1031-1035
I. creation and constraint of MySQL table
[principle] several ways of horizontal penetration
When defining an array, the size must be constant
The principle of inverse Fourier transform (IFFT) in signal processing
MySQL gets the maximum value record by field grouping
数据库SQL语句实现数据分解的函数查询
Object detection: object_ Detection API +ssd target detection model
How to query the submission number of a version
STM32F103ZET6程序移植为C8T6+C8T6下载程序flash timeout的解决方案