当前位置:网站首页>Leetcode69. x 的平方根
Leetcode69. x 的平方根
2022-07-30 01:02:00 【Java全栈研发大联盟】
题目传送地址:https://leetcode.cn/problems/sqrtx/submissions/
运行效率:
代码如下:
class Solution {
public static int mySqrt(int x) {
for(int i=0;i<=x;i++){
long powNum = (long) i * i; //这里要小心数字溢出的情况,所以用long类型
if(powNum>x){
return i-1;
}
}
return x;
}
}
边栏推荐
- 某团实习面经
- i.MX6U-driver development-3-new character driver
- 什么专业越老越吃香?
- Worthington dissociating enzyme: detailed analysis of neutral protease (dispase)
- LeetCode/Scala - without the firstborn of the string of characters, the longest text string back
- He used to cells harvested trypsin & release procedure
- 液压滑环的应用介绍
- 泰克Tektronix示波器软件TDS2012|TDS2014|TDS2022上位机软件NS-Scope
- 1592. 重新排列单词间的空格
- Navicat for mysql crack version installation
猜你喜欢
exness:美国GDP萎缩,日元反弹受捧
Fabric 编写案例 链码
Validation Framework-01
基于SSM开发实现校园疫情防控管理系统
Towhee 每周模型
How to realize the frame selection of objects in canvas (6)
重新定义分析 - EventBridge 实时事件分析平台发布
Weekly recommended short video: What is R&D efficiency?It can achieve anti "involution"?
What majors become more popular the older they get?
canvas 中如何实现物体的框选(六)
随机推荐
二维数组的查找
重新定义分析 - EventBridge 实时事件分析平台发布
LeetCode / Scala - 无重复字符最长子串 ,最长回文子串
Toutiao We-Media Operation: How to Gain 500+ Fans in Toutiao Today?
Worthington Enzymatic Cell Harvest & Cell Adhesion and Harvest
Detailed introduction of @RequestParam annotation
百度智能云章淼:详解企业级七层负载均衡开源软件BFE
Worthington's tried and tested cell isolation system protocols
【mysql】Mysql公用表表达式with as
Recommendation system: collection of user "behavioral data" [use Kafka and Cassandra to process data] [if it overlaps with business data, it also needs to be collected independently]
Interviews with big factories under the trend of layoffs: "ByteDance"
Reconstruction of binary tree
Self-study HarmonyOS application development (56) - Use Service to ensure that the application runs continuously in the background
Navicat for mysql破解版安装
Replace the executable file glibc version of the one
Fabric 编写案例 链码
Fabric 私有数据案例
泰克Tektronix示波器软件TDS2012|TDS2014|TDS2022上位机软件NS-Scope
string replace spaces
Worthington Papain & Chymotrypsin & DNase I