leetcode69---Sqrt(x)

難度:easy Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer 思路: 兩分法,看了很多code,貌似每次縮小範圍的時候,都是low=mid +1,試過high =mid -1 或者 low =mid都不行,原因至今未知。
本站公眾號
   歡迎關注本站公眾號,獲取更多信息