classSolution:""" @param x: An integer @return: The sqrt of x """defsqrt(self,x):# write your code herefront=0end=xifx==0orx==1:returnxresult=0whilefront<=end:mid=(front+end)/2ifmid*mid==x:returnmidelifmid*mid>x:end=mid-1else:front=mid+1# x=2147483647, return 46340returnfront-1