模拟一javascript --输出可能删掉的整数
readline = require("readline");
rl = readline.createInterface({
input:process.stdin,
output:process.stdout,
})
var index=0;
var n;
rl.on('line',function(line){
if(index%2==0){
n=parseInt(line);
}
if(index%2==1){
var arr = line.split(' ');
console.log(num(n,arr).join(' '));
}
index++;
})
function num(n,arr){
var n=n;
var brr=[];
arr.forEach(function(e){
brr.push(parseInt(e));
});
brr.sort(function(a,b){
return a-b;
});
var result=[];
if((brr[0]+n-1)==(brr[n-1])){
if(brr[0]==1){
result.push(brr[n-1]+1);
}else{
result[0]=(brr[0]-1);
result[1]=(brr[n-1]+1);
}
}else{
if((brr[0]+n)==(brr[n-1])){
var s=new Set(brr);
if(s.size==n){
for(var i=0;i<n-1;i++){
if((brr[i]+1)==(brr[i+1])){
continue;
}else{
result.push(brr[i]+1);
}
}
}else{
result[0]="mistake";
}
}else{
result[0]="mistake";
}
}
return result;
}