看啥推荐读物
专栏名称: 程序IT圈
一个学习编程技术和读者福利共存的公众号,每天推送高质量的优秀博文和原创文章,开源项目,实用工具,面试技巧等 。公众号每月至少一次读者送书福利! 关注置顶,不错过精彩推送!
今天看啥  ›  专栏  ›  程序IT圈

​LeetCode刷题实战69:x 的平方根

程序IT圈  · 公众号  · 程序员  · 2020-10-17 10:05
算法的重要性,我就不多说了吧,想去大厂,就必须要经过基础知识和业务逻辑面试+算法面试。所以,为了提高大家的算法能力,这个公众号后续每天带大家做一道算法题,题目就从LeetCode上面选 !今天和大家聊的问题叫做 x 的平方根,我们先来看题面:https://leetcode-cn.com/problems/sqrtx/Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integer.Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned.题意实现 int sqrt(int x) 函数。计算并返回 x 的平方根,其中 x 是非负整数。由于返回类型是整数,结果只保留整数的部分,小数部分将被舍去。样例示例 1:输入: 4输出: 2示例 2:输入: 8输出: 2说明: 8 的平方根是 2 ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照