[LeetCode/릿코드] 69. Sqrt(x)
문제 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class Solution { public int mySqrt(int x) { int answer = 0; for(long i=1; i x) { answer = (int) (i-1); break; }else if(i * i == x) { answer = (int) i; break; } } return answer; } } cs