| 1 | class Solution { |
| 2 | public int mySqrt(int x) { |
| 3 | |
| 4 | int start=1; |
| 5 | int end=x; |
| 6 | |
| 7 | while(start<=end) |
| 8 | { |
| 9 | int mid = start+(end-start)/2; |
| 10 | if(mid<=x/mid) start=mid+1; |
| 11 | else end=mid-1; |
| 12 | } |
| 13 | return end; |
| 14 | } |
| 15 | } |
nothing calls this directly
no outgoing calls
no test coverage detected