难度:easy

Implement int sqrt(int x).

Compute and return the square root of x.

x is guaranteed to be a non-negative integer

leetcode69---Sqrt(x)


思路: 两分法,看了很多code,貌似每次缩小范围的时候,都是low=mid +1,试过high =mid -1 或者 low =mid都不行,原因至今未知。

leetcode69---Sqrt(x)



相关文章:

  • 2021-08-18
  • 2021-12-09
  • 2021-10-05
  • 2022-01-14
  • 2021-08-30
猜你喜欢
  • 2022-01-31
  • 2021-05-27
  • 2021-10-20
  • 2022-01-25
  • 2021-05-16
相关资源
相似解决方案