当前位置:网站首页>Not 67 days, square root
Not 67 days, square root
2022-07-29 04:16:00 【A little Ming】

class Solution {
public int mySqrt(int x) {
int l = 0, r = x, ans = -1;
while (l <= r) {
int mid = l + (r - l) / 2;
if ((long) mid * mid <= x) {
ans = mid;
l = mid + 1;
} else {
r = mid - 1;
}
}
return ans;
}
}
author :LeetCode-Solution
link :https://leetcode.cn/problems/jJ0w9p/solution/qiu-ping-fang-gen-by-leetcode-solution-ybnw/
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 .
边栏推荐
- What the hell is this error? It doesn't affect the execution result, but it always reports errors when executing SQL... Connecting maxcomputer uses
- Differences and principles of bio, NiO and AIO
- 请问,在sql client中,执行insert into select from job时,如何单
- Interview notes of a company
- 12. Priority queue and inert queue
- Lua language (stm32+2g/4g module) and C language (stm32+esp8266) methods of extracting relevant data from strings - collation
- 12.优先级队列和惰性队列
- 请问为什么我进行mysql数据update时,kafka中采集到的是先删除原纪录(op d)再新增新
- Locker 2022.1.1
- MPU6050
猜你喜欢
![[hands on deep learning] environment configuration (detailed records, starting from the installation of VMware virtual machine)](/img/fe/8c707c30c734de7bb76ea68134842c.png)
[hands on deep learning] environment configuration (detailed records, starting from the installation of VMware virtual machine)

Common components of solder pad (2021.4.6)

Can you really write restful API?

Fu Yingna: Yuan universe is the new generation of Internet!

HC06 HC05 BT

Beginner: array & String

Design of environment detection system based on STM32 and Alibaba cloud

你真的会写Restful API吗?

Class starts! See how smardaten decomposes complex business scenarios

10. Fallback message
随机推荐
[hands on deep learning] environment configuration (detailed records, starting from the installation of VMware virtual machine)
不会就坚持63天吧 最大的异或
The return value of the function is the attention of the pointer, the local variables inside the static limit sub function, and how the pointer to the array represents the array elements
The table of antd hides the pager when there is only one page
Labelme cannot open the picture
Install the laser of ROS_ scan_ Problems encountered in match library (I)
Opengauss pre check installation
10.回退消息
Implementation of jump connection of RESNET (pytorch)
优炫数据库有办法查到主集群每天传给备集群的日志量吗?
Multi rotor six axis hardware selection
The structure pointer must be initialized, and the pointer must also be initialized
C语言:结构体简单语法总结
C语言:联合体知识点总结
The difference between dynamic, VaR and object in fluent
Whole house WiFi solution: mesh router networking and ac+ap
不会就坚持62天吧 单词之和
大佬们flink的JDBC SQL Connector现在不支持所有的数据库吗,例如vertica?
“蔚来杯“2022牛客暑期多校训练营2 H
C语言:浅谈各种复杂的声明