LeetCode||69. Sqrt(x)
来源:互联网 发布:linux 安装2个jdk 编辑:程序博客网 时间:2024/06/18 09:24
Implement int sqrt(int x)
.
Compute and return the square root of x.
x is guaranteed to be a non-negative integer.
Example 1:
Input: 4Output: 2
Example 2:
Input: 8Output: 2Explanation: The square root of 8 is 2.82842..., and since we want to return an integer, the decimal part will be truncated.
取平方根,去尾法
class Solution(object): def mySqrt(self, x): """ :type x: int :rtype: int """ return int(x**.5)
阅读全文
0 0
- LeetCode 69. Sqrt(x)
- LeetCode 69.Sqrt(x)
- LeetCode --- 69. Sqrt(x)
- [Leetcode] 69. Sqrt(x)
- [leetcode] 69.Sqrt(x)
- Leetcode-69.Sqrt(x)
- leetcode--69.sqrt(x)
- LeetCode 69. Sqrt(x)
- leetcode 69. Sqrt(x)
- 【LeetCode】69. Sqrt(x)
- 69. Sqrt(x) LeetCode
- [leetcode] 69. Sqrt(x)
- leetcode 69. Sqrt(x)
- LeetCode 69. Sqrt(x)
- LeetCode 69. Sqrt(x)
- leetcode-69. Sqrt(x)
- [leetcode]69. Sqrt(x)
- LeetCode-69.Sqrt(x)
- 装机软件清单
- 马云:未来三十年,我们要把机器变成人
- A
- “聚势创业 筑梦创新” 2017国际双创大会暨国际创业创新大赛正式启动
- vswitch ovsschema 结构,更好的使用ovs-vsctl命令,操作ovsdb
- LeetCode||69. Sqrt(x)
- 年历 | IT史上的今天
- 电商该如何正确的选择适合的服务器?
- tomcat启动报错:create[localhost:8005]:java.net.SocketException:Unrecognized Windows Sockets error: 10106
- H5 人脸检测
- 运用@Transactional,自己抛出异常时不会回滚的原因
- Cas 从https改成http Google浏览器无法实现单点登录
- 数据库开源框架GreenDao的使用解析
- 二维数组分组