LeetCode

来源:互联网 发布:淘宝女围巾推荐知乎 编辑:程序博客网 时间:2024/06/08 04:16

Q:
Implement int sqrt(int x).

Compute and return the square root of x.

A:

class Solution(object):    def mySqrt(self, x):        """        :type x: int        :rtype: int        """        return int(x ** 0.5)

(ノ ̄▽ ̄) py的优势

原创粉丝点击