
알고리즘/문제풀이 2022. 6. 20.
[LeetCode] 69. Sqrt(x) (Easy) 풀이
❓ 문제 Given a non-negative integer x x. Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned. pow(x, 0.5) or x ** 0.5. 음이 아닌 정수 x x가 주어진다. 리턴타입이 정수형이기 때문에 소수점 이하 자리수는 잘리고 오직 결과의 정수부분만 리턴한다. pow(x, 0.5) or x ** 0.5. Example 1: Input: x = 4 Output: 2 Example 2: Input: x = 8 Output: 2 Explanation: The square root of 8 is 2.82842....
