bool isPerfectSquare(int num) {
int left = 1;
int right = num / 2;
int mid;
while(left <= right){
mid = (left + right) >> 1;
if(mid * mid >= num || mid >= 46341){
right = mid - 1;
}else{
left = mid + 1;
}
}
return left * left == num;
}
46341 = sort(INT_MAX)