input: Write a python function to compute the integer square root of a number.
  assert sqrt(0) == 0
  assert sqrt(1) == 1
  assert sqrt(4) == 2
  assert sqrt(10) == 3
  assert sqrt(16) == 4
output: def sqrt(x):
      if x < 0:
          raise ValueError("Cannot compute the square root of a negative number")
      if x == 0:
          return 0
      left, right = 1, x
      while left <= right:
          mid = (left + right) // 2
          if mid * mid == x:
              return mid
          elif mid * mid < x:
              left = mid + 1
          else:
              right = mid - 1
      return right