the task says, we need
Input: x = 4 // input
Output: 2 // we have to return
else if(mid*mid >x) right = mid
if the mid * mid ( target ) is bigger we're going left side of the binary search ( in the case with numbers, not arrays, we're doing like this, if mid before was 4 , it is our input in first iteration, new value will be 2;
else left = mid+1
says, we going to the right side of the binary search, and 2 + 1 = 3 and we are going to search again through while
the task says, we need
Input: x = 4 // input
Output: 2 // we have to return
if the mid * mid ( target ) is bigger we're going left side of the binary search ( in the case with numbers, not arrays, we're doing like this, if mid before was 4 , it is our input in first iteration, new value will be 2;
says, we going to the right side of the binary search, and 2 + 1 = 3 and we are going to search again through while
thanks for reply