Given a non-negative integer x, compute and return the square root of x.
Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned.
class Solution:
def mySqrt(self, x: int) -> int:
return int(sqrt(x))
이건 거의 10초컷이었는데.. 풀고도 의아했던 난이도..
sqrt 함수 안쓰고 내가 직접 만드는건지 뭔지...;
int() 형변환 대신 trunc 함수를 사용해도 된다