此题来源于牛客网,我给出一种答案;
boolean[] k = new boolean[length];
for(int i = 0; i < k.length; i++){
if(k[numbers[i]] == true){
duplication[0] = numbers[i];
return true;
}
k[numbers[i]] = true;
}
return false;
}