Error:

  1. do not use (left + right) / 2, it will overflow
  2. I do not like the common, since it has so much different than original binary search, so we can use a variable to store the variable.