public static int getVersionBug(int[] version){
int low = 0;
int high = version.length - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (!IsBug(mid)) {
high = mid - 1;
}else if( !IsBug(mid+1)){
return mid;
}else if(IsBug(mid)){
low = mid+1;
}
}
return -1;
}
public static Boolean IsBug(int sn){
if (sn < BUG_NUMBER) {
return true;
}else {
return false;
}
}